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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux