note 80182 deleted from function.array-keys by nlopess
| From: | nlopess@php.net | Date: | Thu, 03 Jan 2008 11:43:29 +0000 |
| Subject: | note 80182 deleted from function.array-keys by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134710@lists.php.net to get a copy of this message | ||
Note Submitter: me
----
<?php
//example multidimensional array
$array = array("about.php", "contact.php", "projects.php" =>
array("project_1.php" => array("project_1a.php", "project_1b.php"),
"project_2.php"));
//next line shows that behavior of array_keys is unexpected as it finds key of a second level
subarray
if(in_array('project_1.php',array_keys($array)))echo 'not working as expected';
?>
live demonstration: http://www.inverudio.com/test.php