note 43636 added to function.in-array
| From: | info at eversite dot com | Date: | Mon, 28 Jun 2004 19:56:46 +0000 |
| Subject: | note 43636 added to function.in-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-72073@lists.php.net to get a copy of this message | ||
There are some times when you need to search for the keys in a multidimensional associative array.
Looking around the web for a solutions is very hard. This snippid does the job.
<?php
if (in_array($key1, array_keys($multi_array[$key2]))) {
echo $multi_array[$key2][$key1];
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.in-array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43636
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43636&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43636&report=yes
Search -- http://master.php.net/manage/user-notes.php