"_lallous" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> 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.
Thanks. I guess I should have tried that to see what
happens. Interesting. I guess both C and php use
an array of char. The difference is that there is no length
attribute in C arrays, so you have to mark the end with \0.
php arrays have a length attribute, so \0 terminator is
unnecessary.
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]