Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Transfer from array to array
April 26, 2010, 1:26 am
rate this thread
Ok now that I've got the start of my card game going, I need to make a
third array that corresponds to the values generated from the shuffle().
My constant array $cards() holds the names of the cards in suit and
numerical order. So that will always remain intact regardless of what any
other values change.
Let's say shuffle() produced array as 72, and that corresponds to "10 of
spades" in the cards array. How could I easily write the code to do this
without creating 104 lines of code to do it with?
For or "foreach"?