Hi, In this php tutorial you will learn how to build a random link rotator. Basically, we’ll build a php array with the links needed to rotate and then we’ll print to user the link randomly.
1 2 3 4 5 6 7 8 9 10 11 |
<?php $links = array("link 1", "link 2", "link 3"); $max = sizeof($links); $rand = rand(0, $max); print $links[$rand]; ?> |