Jump to content

random generation script prob


primefalcon
 Share

Recommended Posts

Hi I wrote up a simple random generation script quickly which works as intended, however as is common I have ran into a little problem, here's the code:

<?php$blogs_array = array('<li><a href="url">site1</a></li>','<li><a href="url">site2</a></li>','<li><a href="url">site3</a></li>');shuffle ($blogs_array);?><?php for ($i = 0; $i < 3; $i++) {		echo "$blogs_array[$i]";}?>

I've replaced the array urls with just url for privacy.My problem is that with the script running, the same link can appear twice, is there a way to prevent an entry from appearing more than once?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...