note 40194 added to function.array-search
| From: | pta at rogers dot com | Date: | Tue, 24 Feb 2004 23:49:54 +0000 |
| Subject: | note 40194 added to function.array-search | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65676@lists.php.net to get a copy of this message | ||
Can $needle be a partial associated array?
I figured this should work but don't think so? Is there a simple solution?
In other words,
$haystack = array (
array ('first'=>"tom", 'mid'=>"paul",
'last'=>"smith"),
array ('first'=>"paul", 'mid'=>"tony",
'last'=>"jones")
);
$needle = array ('first'=>"tom", 'last'=>"smith");
$key = array_search ($needle, $haystack);
would have thought that would return $key = 0
Am i hoping for too much here?
----
Manual Page -- http://www.php.net/manual/en/function.array-search.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40194
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40194&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40194&report=yes
Search -- http://master.php.net/manage/user-notes.php