note 72294 deleted from function.array-slice by nlopess

From: Date: Thu, 11 Jan 2007 22:37:44 +0000
Subject: note 72294 deleted from function.array-slice by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-121568@lists.php.net to get a copy of this message
Note Submitter: wgilk *at* reliablesites *dot* com ---- <?php function array_remove ($key, &$array) { if (! isset ($array[$key])) return false; $return = $array[$key]; unset ($array[$key]); return $return; } ?> I thought maybe it would be useful to anyone looking for a simple way to slice a single element off an associative array.

« previous php.notes (#121568) next »