note 16021 deleted from function.explode by jimw
| From: | jimw@php.net | Date: | Fri, 07 Dec 2001 21:25:19 +0000 |
| Subject: | note 16021 deleted from function.explode by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22011@lists.php.net to get a copy of this message | ||
Pretty obvious, but be careful if the seperator is in front of the string you want to explode.
$array[0] will be "" and the different parts will only start at $array[1]
Example:
$string = "-first-second-third";
$array = explode("-",$string);
Gives this:
$array[0] => ""
$array[1] => "first"
$array[2] => "second"
$array[3] => "third"
Either start using your array at position 1, either trim your string beforehand.