note 113919 added to function.mb-check-encoding
| From: | eyecatchup at gmail dot com | Date: | Tue, 17 Dec 2013 18:18:28 +0000 |
| Subject: | note 113919 added to function.mb-check-encoding | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-197961@lists.php.net to get a copy of this message | ||
Unlike other comments suggest, there's no need to serialize a string to use preg_match's
"u" modifier for testing if a string is valid UTF-8. You can just use
<?php
function is_utf8($str) {
return (bool) preg_match('//u', $str);
}
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.mb-check-encoding.php
Edit -- https://master.php.net/note/edit/113919
Del: integrated -- https://master.php.net/note/delete/113919/integrated
Del: useless -- https://master.php.net/note/delete/113919/useless
Del: bad code -- https://master.php.net/note/delete/113919/bad+code
Del: spam -- https://master.php.net/note/delete/113919/spam
Del: non-english -- https://master.php.net/note/delete/113919/non-english
Del: in docs -- https://master.php.net/note/delete/113919/in+docs
Del: other reasons-- https://master.php.net/note/delete/113919
Reject -- https://master.php.net/note/reject/113919
Search -- https://master.php.net/manage/user-notes.php