note 33878 added to function.str-split
| From: | k at skreel dot org | Date: | Thu, 10 Jul 2003 00:36:08 +0000 |
| Subject: | note 33878 added to function.str-split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51813@lists.php.net to get a copy of this message | ||
str_split for older versions of PHP, it should behave just the same (let's hope that code
indentation remains the same ^^).
function str_split($chaine, $length=1)
{ $retour= FALSE;
$incrmt= (int)$length;
if (0 < $incrmt)
{ $retour= array();
$offset= 0;
$limite= strlen($chaine);
while ($offset < $limite)
{ $retour[]= substr($chaine, $offset, $incrmt);
$offset += $incrmt;
}
}// if (0 < $incrmt)
return ($retour);
}
----
Manual Page -- http://www.php.net/manual/en/function.str-split.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33878
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33878&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33878&report=yes