HuyPV
Thursday, December 23, 2010
function str_split($str, $len) {
$arr = array();
$from = 0;
$l = strlen($str);
do {
$arr[] = substr($str, $from, $len);
$from += $len;
} while ($from < $l);
return $arr;
}
Title:
PHP split string by length
Description:
function str_split($str, $len) { $arr = array(); $from = 0; $l = strlen($str); do { $arr[] = substr($str, $from, $len); ...
...
Rating:
4