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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-30 04:32 UTC] cynic@php.net
RTFM: array_flip()
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 28 10:01:29 2024 UTC