note 39177 added to function.explode

From: Date: Mon, 19 Jan 2004 23:03:35 +0000
Subject: note 39177 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-63846@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/function.explode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+39177 Delete -- http://master.php.net/manage/user-notes.php?action=delete+39177&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+39177&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#63846) next »