note 110458 deleted from function.array-flip by googleguy
| From: | googleguy@php.net | Date: | Wed, 24 Oct 2012 13:40:08 +0000 |
| Subject: | note 110458 deleted from function.array-flip by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191522@lists.php.net to get a copy of this message | ||
Note Submitter: mahmutta at gmail dot com
----
Here is my array flip function for multidimensional arrays. Its more simple and light
<?php
/*
* Array Flip Function For Multidimensional Arrays
* Mahmut GÃLERCE mahmutta[at]gmail.com
*/
function array_flip_recursive($array) {
$return=array();
foreach ($array as $k=>$v) {
if(is_array($v))
$return[''.$v] = array_flip_recursive($v);
else
$return[''.$v] = $k ;
}
return $return;
}
?>