Re: [please ignore!] Re: [PHP] [from internals] Re: ref fix revisited

From: Date: Tue, 13 Sep 2005 08:33:34 +0000
Subject: Re: [please ignore!] Re: [PHP] [from internals] Re: ref fix revisited
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-222255@lists.php.net to get a copy of this message
Jochem Maas wrote:
Jasper Bryant-Greene wrote:
<?php $value_parts = split('/\w/', trim($value)); $value = strtolower($value_parts[0]); ?> ... which has the advantage of being a bit more readable too.
debatable ... no bog deal either way ... $value = split('/\w/', trim($value)); $value = strtolower($value[0]); ... saves a var, no?
Yeah, but not as readable. $value is first a string, then an array, then a string again. At one point it contains the whole value, then the string split into words, then the first word in lowercase. The simple name 'value' doesn't really explain what it's standing for in all those situations. But yeah, no big deal either way. -- Jasper Bryant-Greene Freelance web developer http://jasper.bryant-greene.name/

« previous php.general (#222255) next »