SuperMode55
11-21-2011, 01:15 AM
Hello I am fairly new to PHP so go easy on me. I am making a game displaying 5 cards in the browser. I am using an array to store my cards. Then I tell it to echo a random array and in the same time I store that result in a variable called $card1 through $card5, problem is that I get the same cards sometimes. What would be the best way to get rid of this issue.
The way I thought about doing it was to echo $card1 and then echo $card2 except cannot be equal to $card1, I used the != operator witch didn't work, just need help with what can be used in a statement where you echo something out of a list with the exception of something else of that list so i dont have duplicates.Thanks.
The way I thought about doing it was to echo $card1 and then echo $card2 except cannot be equal to $card1, I used the != operator witch didn't work, just need help with what can be used in a statement where you echo something out of a list with the exception of something else of that list so i dont have duplicates.Thanks.