note 29436 deleted from function.array-search by felipe
| From: | felipe@php.net | Date: | Sun, 10 Feb 2008 13:11:35 +0000 |
| Subject: | note 29436 deleted from function.array-search by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-135966@lists.php.net to get a copy of this message | ||
Note Submitter: Fspillner at web dot de
----
If you wanna find a value in multidimensional array with array_search. You should do the following:
Use For-Each, that it solves your Problem!
Example:
$map = array( array( Name=>'Jordan' ),
array( Name=>'Oneal' )
);
<?php
$search_value = "Jordan";
foreach ($map as $key => $row)
{
foreach($row as $cell)
{
if ($cell == $search_value)
print $key;
}
}
?>