Mudsaf Posted January 16, 2013 Share Posted January 16, 2013 (edited) example i got this script $a = rand(1, 4);$b = rand(1, 4);$c = rand(1, 4);.. more values $a2 = rand(1, 20);$b2 = rand(1, 20);$c2 = rand(1, 20);...more values how do i make script that checks that for every value if ($a <> $b && $a2 <> $b2 { } whitout having to do million values listed. So i dont want any $a && a2 values to be same as any other for example $b && b2. I guess its pretty hard to explain but lets assume i have deck of cards and i dont want same card with same color twice there. Edited January 16, 2013 by Mudsaf Link to comment Share on other sites More sharing options...
jeffman Posted January 16, 2013 Share Posted January 16, 2013 May a suggest a different approach? Fill an array with the values you need, then shuffle it. $nums = range(1,20);shuffle($nums); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now