note 24533 added to function.unset

From: Date: Tue, 20 Aug 2002 18:03:34 +0000
Subject: note 24533 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-35263@lists.php.net to get a copy of this message
Look at this example: <? $test = array('one', 'two', 'three'); for ($i = 0; $tmp = $test[$i]; $i++) { echo $test[$i] . " "; } echo " - "; $id = array_search("two", $test); unset($test[$id]); for ($i = 0; $tmp = $test[$i]; $i++) { echo $test[$i] . " "; } ?> results: one two three - one The function unset() unsets the given element and all elements after. -- http://www.php.net/manual/en/function.unset.php http://master.php.net/manage/user-notes.php?action=edit+24533 http://master.php.net/manage/user-notes.php?action=delete+24533 http://master.php.net/manage/user-notes.php?action=reject+24533

« previous php.notes (#35263) next »