First open up your up a file in your text editor of choice. In this example I’m going to call the file ad.php and just include it in the page I wish for it to show up in.
Second I’ll define my ads:
$ad = "We got the goods here";
$ad = "Give us your money";
$ad = "blah blah blah";
Now that you’ve got an array defined for your ads we will use rand() to call them up randomly:
$random = rand(1, sizeof($ad));
That’s it. Hope this is helpful.