note 33640 added to function.unset

From: Date: Wed, 02 Jul 2003 16:11:28 +0000
Subject: note 33640 added to function.unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-51373@lists.php.net to get a copy of this message
is it possible to use the unset() command to remove variables from an array? for example $keywords is an array of words in a search engine i made. Would this code work to remove simple words from it such as 'a', 'an', or 'in'... foreach($keywords as $test) { if ($test = "a") {unset($test);} if ($test = "an") {unset($test);} if ($test = "in") } ---- Manual Page -- http://www.php.net/manual/en/function.unset.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33640 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33640&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33640&report=yes

« previous php.notes (#51373) next »