note 33919 deleted from function.str-split by didou
| From: | didou@php.net | Date: | Fri, 11 Jul 2003 08:09:27 +0000 |
| Subject: | note 33919 deleted from function.str-split by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51889@lists.php.net to get a copy of this message | ||
Note Submitter: funnykindaguy@yahoo.com
----
Untill PHP 5 comes out, the following function will do the exact same thing (from PHP 3.0.6 and up),
is just as simple to use and only takes two lines!
function jpm_split($string, $split_length=1, $separator=':') {
return explode($seperator, chunk_split($string, $split_length, $seperator));
}
It works the same way and has the same parameters with the addition of "separator". This
optional parameter is necessary in case you know that your string already contains the default
separator ':' in it. In which case you would simply change it to any other safe character
in order for the function to work properly.