title: How can i redirect my visitors to different different urls like say after every 10 mins or 15 mins vica-versa?
body: <p>I need a php code which i upload on my domain. what it will do is redirect visitors to different different urls based on certain time period like say for the first 10 mins it should redirect to google.com later on for the next 10 mins to gmail or something else whatever which i specify and so on. Is there is any way to do that coz right now i have to do it manually which is really hectic. All i got so far is this but its not working!
  `</p>
  <pre><code>$tym = date(&quot;h:i&quot;);
  echo $tym;
  
  if ($tym &gt;= &quot;06:10&quot; &amp;&amp; $tym &lt; &quot;06:20&quot;){                                                 
  $urls = array(
      array('url' =&gt; 'http://website1.com'),
  );}
  
  if ($tym &gt;= &quot;06:20&quot; &amp;&amp; $tym &lt; &quot;06:30&quot;){                                                 
  $urls = array(
      array('url' =&gt; 'http://website2.com'),
  );}
  //and so on
  
  $probs = array();
  foreach ($urls as $i =&gt; $url) {
      $probs = array_merge($probs, array_fill(1, $i));
  }
  
  $rand = array_rand($probs);
  var_dump($rand);
  var_dump($urls[$probs[$rand]]['url']);
  
  header('Location: '.$urls[$probs[$rand]]['url']);`
  </code></pre>
  <p>Need some help please! Thanks in advance.</p>