note 16823 added to function.explode
| From: | drtebi at yahoo dot com | Date: | Wed, 14 Nov 2001 23:52:08 +0000 |
| Subject: | note 16823 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20848@lists.php.net to get a copy of this message | ||
It is important to not that explode will re-declare an array. If you have an array in your script
with five elements, and create an array with the same name using explode, all elements of the first
array will be lost.
Example:
$n = array ('zero', 'one', 'two', 'three',
'four');
print $n[4]; // prints four
$n = explode(' ', 'null eins zwei drei'); // array gets re-declared
print $n[4]; // prints nothing(!)
DrTebi
--
http://www.php.net/manual/en/function.explode.php
http://master.php.net/manage/user-notes.php?action=edit+16823
http://master.php.net/manage/user-notes.php?action=delete+16823
http://master.php.net/manage/user-notes.php?action=reject+16823