Flipping an array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
localhost
Forum Commoner
Posts: 43
Joined: Tue Dec 07, 2004 4:52 am
Location: islamabad
Contact:

Flipping an array

Post by localhost »

I want to flip an array without using array_flip funtion because i cant seem to find a way to include the duplicate values like [4]=>10 and [5]=>10, flipping this will result in [10]=4 and losing the value of 5...
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Duplicate keys can't be done. You'll have to change the key value to something else.
Post Reply