Page 1 of 1

temporarily removing entries from an array

Posted: Tue Mar 22, 2011 6:57 pm
by joevis
I have program that is basically a random generator that has 5 arrays with about 50 items in each. Right now it shuffles all five arrays and outputs the first 3 values. What would be the best way for the user to remove certain items before shuffling the arrays?

Just started programming php a few days ago, sorry if this is a noob question!

Thanks!

Re: temporarily removing entries from an array

Posted: Tue Mar 22, 2011 8:18 pm
by gully_mi_seh
as I can see you understand the array , so the easier way from my point of view will be to but the items you dont want to be available into a array $bad_item then when shuffling you will set a condition whom will check if the outputted item is or is not into the array $bad_item, I suggest you to use in_array() whom will check the array content an return a Boolean .