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!
temporarily removing entries from an array
Moderator: General Moderators
-
gully_mi_seh
- Forum Newbie
- Posts: 14
- Joined: Fri Mar 18, 2011 8:48 pm
Re: temporarily removing entries from an array
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 .