|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #10551 array_switch ( permute the keys w/ values)
Submitted: 2001-04-29 08:38 UTC Modified: 2001-04-30 04:32 UTC
From: teo at gecadsoftware dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0 Latest CVS (29/04/2001) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: teo at gecadsoftware dot com
New email:
PHP Version: OS:


 [2001-04-29 08:38 UTC] teo at gecadsoftware dot com
I found myself with an array like
$a = array (0 => "Foo", 1 => "Bar" );

and thought it would be cool to be able to say 
$a = array_permute/switch ($a);

a being now: array ("Foo" => 0 , "Bar"=>1);
the value colision can use the style of extract() 3rd parameter.

what do you think?

-- teodor


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-30 04:32 UTC]
RTFM: array_flip()
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 10:01:28 2024 UTC