title: Displaying random ad in my website using php
body: <p>I need to display random Advertisement in my webpage. I am using separate files to display ads</p>
  
  <p><strong>i.e., 1.txt, 2.txt .. 10.txt</strong></p>
  
  <p>Each files should be displayed in every refresh of page.
  I mean 1.php should be displayed in first refresh and 2.php should be displayed on another refresh. It might be random. but all the pages should be displayed randomly</p>
  
  <p>How can i do this using <code>rand</code>  function in php ?</p>
  
  <p>Here is what i tried. </p>
  
  <pre><code>$result_random = rand(1,10); 
  if($result_random &lt;= 2)
  { 
  require ('ad1.txt');
  } 
  </code></pre>
  
  <p>But i don't know how to proceed. How can i do this ?</p>