Re: PHP6, UTF & strlen
| From: | Richard Davey | Date: | Mon, 28 Nov 2005 16:12:12 +0000 |
| Subject: | Re: PHP6, UTF & strlen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226547@lists.php.net to get a copy of this message | ||
Hi Jared,
Monday, November 28, 2005, 4:04:29 PM, you wrote:
> Just been looking over some code, and saw
> if (strlen($data) !== file_put_contents($filename, $data))
> ....
> where $data is UTF8, so wondering if this is going to break
> in PHP6, if so what should be the equivalent code?
If $data is UTF8 already, shouldn't you really be using mb_strlen? In
which case, I'd expect it to function exactly the same in PHP6.
Cheers,
Rich
--
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk