temporarily removing entries from an array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
joevis
Forum Newbie
Posts: 5
Joined: Tue Mar 22, 2011 6:50 pm

temporarily removing entries from an array

Post 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!
gully_mi_seh
Forum Newbie
Posts: 14
Joined: Fri Mar 18, 2011 8:48 pm

Re: temporarily removing entries from an array

Post 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 .
Post Reply