note 40194 rejected from function.array-search by irchtml
| From: | irchtml@php.net | Date: | Wed, 25 Feb 2004 05:40:21 +0000 |
| Subject: | note 40194 rejected from function.array-search by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65685@lists.php.net to get a copy of this message | ||
Note Submitter: pta@rogers.com
----
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?