[PHP] Re: why does trim() remove NUL? From: _lallous (elias_bachaalany <email protected>)
Date: 10/15/01

I guess if strlen() fails it returns 0 and if string has no length then it
also returns zero.

I don't think PHP's strings are zero terminated.

$str = "abc\xab\x00defgh";
echo $str;
outputs: abc½ defgh

and doesn't truncate the string.

"John A. Grant" <jazrant <email protected>> wrote in message
news:20011015133545.8434.qmail <email protected>
> Are PHP strings NUL-terminated? If so, why does trim()
> remove the NUL? After using trim() on a blank line, presumably
> strlen() will return 0. How does strlen() work, if the NUL has
> been removed?
>
> --
> John A. Grant * I speak only for myself * (remove 'z' to reply)
> Radiation Geophysics, Geological Survey of Canada, Ottawa
> If you followup, please do NOT e-mail me a copy: I will read it here
>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>