note 21762 deleted from function.array-pop by sniper
| From: | sniper@php.net | Date: | Mon, 03 Feb 2003 16:18:24 +0000 |
| Subject: | note 21762 deleted from function.array-pop by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43337@lists.php.net to get a copy of this message | ||
being fairly new to php
i had many problems trying to "pop" a key/value pair out of a multiarray. after many hours
reading manuals and other notes I find this most reliable...
$a[]=array(a,2,3,4,5);
$a[]=array(b,2,3,4,5);
$a[]=array(c,2,3,4,5);
and so on...
$limit=count($a);
for ($i=1;$i<$limit;$i++){
$target=$a[$i][0];
if ($target<>'b'){
$z[]=$a[$i];
}
}
$z=$a;
not the most complex or spectacular but it's not as cryptic as some others and it can easily be
changed to fit most needs