[thelist] PHP question... checking string length

Christian Heilmann lists at onlinetools.org
Fri Mar 25 12:37:14 CST 2005


>>
>> if ($myString=='') // do something
>>
>> But I recently stumbled upon some code from a much more experienced
>> PHP person test empty strings like so:
>>
>> if (strlen($myString) == 0) // do something
>>
>> Is there any difference/advantage to using one over the other? Only
>> apparently one is using the first method should be marginally faster
>> (no function call). Thanks!
>>  
>>
> The latter actually assumes that $myString is a string an
>
Sorry about that, I  started that answer and then realised it is a 
useless answer.



More information about the thelist mailing list