Em Wed, 22 Jun 2011 12:14:40 +0100, Reindl Harald <h.rei...@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

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to