Changeset 9499 for extensions/LCAS/trunk
- Timestamp:
- Mar 3, 2011, 10:10:09 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/LCAS/trunk/include/functions.inc.php
r9400 r9499 6 6 7 7 /** 8 * Split sa multi-byte string in a array of each of its characters.9 * Many thanks to adjwilliin10 * http:// www.php.net/manual/fr/function.mb-split.php#800468 * Split a multi-byte string in a array of each of its characters. 9 * Many thanks to Whiler ;-) in 10 * http://fr.piwigo.org/forum/viewtopic.php?pid=162907#p162907 11 11 * 12 12 * @param string s: string to split … … 15 15 */ 16 16 function LCAS_mbStringToArray($s) { 17 $l = mb_strlen($s); $a = array(); 18 while ($l) { 19 $a[] = mb_substr($s, 0, 1, 'UTF-8'); 20 $s = mb_substr($s, 1, $l, 'UTF-8'); 21 $l = mb_strlen($s); 22 } 23 return $a; 17 return preg_split('//u', $s, -1, PREG_SPLIT_NO_EMPTY); 24 18 } 25 19
Note: See TracChangeset
for help on using the changeset viewer.