Re: foreach() for strings

From: Date: Wed, 22 Jun 2011 12:14:35 +0000
Subject: Re: foreach() for strings
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-53505@lists.php.net to get a copy of this message
Em Wed, 22 Jun 2011 12:14:40 +0100, Reindl Harald <h.reindl@thelounge.net> escreveu:
Am 22.06.2011 07:24, schrieb Tomas Kuliavas:
2011.06.21 23:27 Reindl Harald rašė:
i do not understand any word and miss a simple str_is_utf8()
Such function uses six lines in PHP.
so why do you not post them?t
It's actually 3 lines: function str_is_utf8($str) { return $str == "" || htmlspecialchars($str, 0, "UTF-8"); } or function str_is_utf8($str) { return preg_match('//u', $str) !== false; } But I agree it wouldn't hurt to have a str_is_utf8. -- Gustavo Lopes

« previous php.internals (#53505) next »