note 33921 deleted from function.str-split by aidan

From: Date: Tue, 01 Jun 2004 06:18:26 +0000
Subject: note 33921 deleted from function.str-split by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-70389@lists.php.net to get a copy of this message
Note Submitter: funnykindaguy@yahoo.com ---- 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($separator, chunk_split($string, $split_length, $separator)); } 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. * In my previous submission I accidentally spelt "separator" as "seperator" which caused the explode function not to work. I apologize for this mistake.

« previous php.notes (#70389) next »