note 112391 added to function.mb-detect-encoding
| From: | eyecatchup at gmail dot com | Date: | Tue, 11 Jun 2013 10:41:43 +0000 |
| Subject: | note 112391 added to function.mb-detect-encoding | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195127@lists.php.net to get a copy of this message | ||
Just a note: Instead of using the often recommended (rather complex) regular expression by W3C
(http://www.w3.org/International/questions/qa-forms-utf-8.en.php), you can simply use the
'u' modifier to test a string for UTF-8 validity:
<?php
if (preg_match("//u", $string)) {
// $string is valid UTF-8
}
----
Server IP: 69.147.83.199
Probable Submitter: 67.159.5.242
----
Manual Page -- http://php.net/manual/en/function.mb-detect-encoding.php
Edit -- https://master.php.net/note/edit/112391
Del: integrated -- https://master.php.net/note/delete/112391/integrated
Del: useless -- https://master.php.net/note/delete/112391/useless
Del: bad code -- https://master.php.net/note/delete/112391/bad+code
Del: spam -- https://master.php.net/note/delete/112391/spam
Del: non-english -- https://master.php.net/note/delete/112391/non-english
Del: in docs -- https://master.php.net/note/delete/112391/in+docs
Del: other reasons-- https://master.php.net/note/delete/112391
Reject -- https://master.php.net/note/reject/112391
Search -- https://master.php.net/manage/user-notes.php