note 107900 deleted from function.str-split by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 May 2012 18:11:33 +0000 |
| Subject: | note 107900 deleted from function.str-split by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187732@lists.php.net to get a copy of this message | ||
Note Submitter: Erick Carvalho
----
For php4 ;D
<?php
function str_split($string, $length = 1)
{
$return = array();
$count = 0;
for($i = 0; $i < strlen($string); $i++)
{
if($i % $length == 0)
{
$count++;
continue;
}
$return[$count] .= $string{$i};
}
return $return;
}
?>