View Single Post
Old 06-17-2008, 03:56 AM   #1 (permalink)
Dave
The Acquainted
 
Dave's Avatar
 
Join Date: Apr 2008
Posts: 110
Thanks: 97
Dave is on a distinguished road
Default array elements into variables and values

If I have an array containing several values (e.g., "green","blue", "white", "sky", "cloud"), how could I generate this from the array:

$sky = "blue"

IOW, how to get "sky" from the array, make it into a variable, and assign to it the value of another array value, in this case "blue"?

I've worked hard on this one, but I just couldn't make it happen. I looked at LIST, IMPLODE, EXPLODE, EXTRACT, etc., but couldn't figure it out.

Thanks for any help!

Dave
Dave is offline  
Reply With Quote