note 35608 deleted from function.str-split by aidan
| From: | aidan@php.net | Date: | Tue, 01 Jun 2004 06:18:14 +0000 |
| Subject: | note 35608 deleted from function.str-split by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70387@lists.php.net to get a copy of this message | ||
Note Submitter: NOSPAM at NOSPAM dot NOSPAM
----
Again, an emulation of str_split for older versions just like the above, only in simpler code
(should work with php3 and 4, I guess...):
function str_split($str,$num = '1') {
if($num < 1) return FALSE;
$arr = array();
for ($j = 0; $j < strlen($str); $j= $j+$num) {
$arr[] = substr($str,$j,$num);
}
return $arr;
}