I am wondering if the shuffle() array function is the correct way to randomize array results.
Basically, I have some ad codes in an array, and I use this to display 1 random ad each time, but there is an ad that seems to appear much much more than anything! I mean out of 20 times it appeared about 18 times. I'd thought by randomizing the results I'd get around equal views for each ad but thats not the case.
It makes me question here. Is shuffle the correct way to do this.. or do I need something totally different?
Here is my code to grab the random ad code at a time.
if (count($eligible_ads) > 1) {
shuffle($eligible_ads);
echo stripslashes($eligible_ads[0]['code']);
}
