This is not really PHP tast, because PHP script is executed on server side, sending HTML page to browser. You need to use Javascript. Or you can try meta refresh tag (within the <head> </head>) like this:
<meta http-equiv="refresh" content="5;url=http://www.test1.com/">But this will only redirect to the www.test1.com after 5 seconds. To rotate multiple sites, you can refresh the same page (omit url attribute), and use frames - so that every time the page is refreshes after 5 seconds, you load next site to the main frame.