note 54806 deleted from function.str-split by aidan
| From: | aidan@php.net | Date: | Sat, 04 Feb 2006 07:14:36 +0000 |
| Subject: | note 54806 deleted from function.str-split by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102966@lists.php.net to get a copy of this message | ||
Note Submitter: LeChuck from <bfpdevel gmail dot com>
----
This is some modification to funcion of ing_rivera.
Now you can use
splitstring($string);
splitstring($string, $length);
<?php
function splitstring($string,$len=0)
{
if($len != 0)
{
for($i=0;$i<ceil(strlen($string)/$len);$i++)
$rtnarr[$i]=substr($string, $len*$i, $len);
}
else
{
for($i=0;$i<strlen($string);$i++)
$rtnarr[$i]=substr($string, $i, 1);
}
return($rtnarr);
}
?>