note 33919 added to function.str-split

From: Date: Fri, 11 Jul 2003 02:53:20 +0000
Subject: note 33919 added to function.str-split
Groups: php.notes 
Request: Send a blank email to php-notes+get-51877@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.str-split.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33919 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33919&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33919&report=yes

« previous php.notes (#51877) next »