php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-30 04:32 UTC] cynic@php.net
RTFM: array_flip()
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 25 03:03:35 2022 UTC