note 39177 rejected from function.explode by betz
| From: | betz@php.net | Date: | Mon, 19 Jan 2004 23:36:21 +0000 |
| Subject: | note 39177 rejected from function.explode by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63850@lists.php.net to get a copy of this message | ||
Note Submitter: scott@pawprint.net
----
I just spent 3 hours fighting with explode and thing I found a quirk them might be interesting to
many...
I was trying to explode the string:
<php
$vTideData = '2004-01-19;04:43;4.7|2004-01-19;09:18;3.9|2004-01-19;13:49;4.6';
$vElements = explode('|',$vTideData);
?>
the above returned only 1 array element.
It seems you need a LEADING seperation character to make it work.
<php
$vTideData = '|2004-01-19;04:43;4.7|2004-01-19;09:18;3.9|2004-01-19;13:49;4.6';
$vElements = explode('|',$vTideData);
?>
works fine.