I have a PHP script that has a link in it. I need this link to be switched out with another one every 2 hours or given amount of time, then switched to the next one. Is it possible?
Yes. You should retrieve the time, and find what hour it is. Then, it would look something like this: if($hour>6) print $links[1]; else if($hour>4) print $links[2]; else if($hour>2) print $links[3]; else print $links[4]; This is just to give you an idea of how it would work.
You'll need to store the time somewhere, possibly a Unix Time stamp to make things easy. Basically every time the link is changed you store the current Unix Time stamp somewhere and then refer to that time stamp to see how many hours have passed: $timeStamp = get_file_contents("timestamp.txt"); // assuming you store it in a text file if ((time() - $timeStamp) / 3600 > 2) // Unix Time Stamps are in seconds, divide by 3600 to get hours { // Link needs to be changed, do so here // file_put_contents("timestamp.txt", time()); // Store the new timestamp } PHP: