note 22287 added to function.explode

From: Date: Wed, 12 Jun 2002 22:07:27 +0000
Subject: note 22287 added to function.explode
Groups: php.notes 
Request: Send a blank email to php-notes+get-31764@lists.php.net to get a copy of this message
There's one strange behaviour which took me some time to figure out. Having $s = "a,b,c,<NULL>,e"; $a = explode(",",$s); for($i = 0; $i < count($a); $i++) echo "$i: " . $a[$i] . "< br>"; one would expect to get s.th. like 0: a 1: b 2: c 3: <NULL> 4: e But, not knowing if by intention or confusion with internal value representation the result is: 0:a 1:b 2:c 3: 4:e -- http://www.php.net/manual/en/function.explode.php http://master.php.net/manage/user-notes.php?action=edit+22287 http://master.php.net/manage/user-notes.php?action=delete+22287 http://master.php.net/manage/user-notes.php?action=reject+22287

« previous php.notes (#31764) next »