Re: why does trim() remove NUL?

From: Date: Mon, 15 Oct 2001 14:42:55 +0000
Subject: Re: why does trim() remove NUL?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-71100@lists.php.net to get a copy of this message
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@zsc.nrcan.zc.ca> wrote in message news:20011015133545.8434.qmail@pb1.pair.com... > 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 > > >

« previous php.general (#71100) next »