note 117588 added to function.mb-split
| From: | StasTrefilov | Date: | Thu, 02 Jul 2015 11:01:50 +0000 |
| Subject: | note 117588 added to function.mb-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203028@lists.php.net to get a copy of this message | ||
a (simpler) way to extract all characters from a UTF-8 string to array with a single call to a
built-in function:
<?php
$str = 'Ðа-
ÑÑÑÑ';
print_r(preg_split('//u', $str, null, PREG_SPLIT_NO_EMPTY));
?>
Output:
Array
(
[0] => Ð
[1] => а
[2] => -
[3] =>
[4] => Ñ
[5] => Ñ
[6] => Ñ
[7] => Ñ
)
----
Server IP: 72.52.91.14
Probable Submitter: 83.167.33.212
----
Manual Page -- http://php.net/manual/en/function.mb-split.php
Edit -- https://master.php.net/note/edit/117588
Del: integrated -- https://master.php.net/note/delete/117588/integrated
Del: useless -- https://master.php.net/note/delete/117588/useless
Del: bad code -- https://master.php.net/note/delete/117588/bad+code
Del: spam -- https://master.php.net/note/delete/117588/spam
Del: non-english -- https://master.php.net/note/delete/117588/non-english
Del: in docs -- https://master.php.net/note/delete/117588/in+docs
Del: other reasons-- https://master.php.net/note/delete/117588
Reject -- https://master.php.net/note/reject/117588
Search -- https://master.php.net/manage/user-notes.php