note 108675 added to function.array

From: Date: Wed, 16 May 2012 20:50:32 +0000
Subject: note 108675 added to function.array
Groups: php.notes 
Request: Send a blank email to php-notes+get-188019@lists.php.net to get a copy of this message
Just wanted to enter better keys swap function as the old one mentioned bellow will not handle multi-associative array (i.e. some_array['banana']['vegetable']). So here we go. function array_two_key_swap( $a ) { $ra = array(); while (list($k1,$v1) = each ($a)) { while (list($k2,$v2) = each ($v1)) { $ra[$k2][$k1]=$v2; } } return $ra; } ---- Server IP: 69.147.83.197 Probable Submitter: 90.177.11.245 ---- Manual Page -- http://www.php.net/manual/en/function.array.php Edit -- https://master.php.net/note/edit/108675 Del: integrated -- https://master.php.net/note/delete/108675/integrated Del: useless -- https://master.php.net/note/delete/108675/useless Del: bad code -- https://master.php.net/note/delete/108675/bad+code Del: spam -- https://master.php.net/note/delete/108675/spam Del: non-english -- https://master.php.net/note/delete/108675/non-english Del: in docs -- https://master.php.net/note/delete/108675/in+docs Del: other reasons-- https://master.php.net/note/delete/108675 Reject -- https://master.php.net/note/reject/108675 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#188019) next »