title: How do I include a text file in PHP as PHP, without printing to the page?
body: <p>I am making myself a webpage that simply redirects to one of a list of other websites upon page load. In order to be able to edit the list of sites more easily, I moved the list to a separate text document. Upon including the file in the PHP code, the browser reverts to parsing HTML and back again when the include is over. As a result, my code gets printed to the screen rather than executed. I am unable to implement PHP headers and tags within the text file, since that would defeat the purpose of keeping it external. As it stands now I have another script that allows me to append links to the file if I want to add them.</p>
  
  <p>index.php, the file I am working with</p>
  
  <pre><code>    &lt;?php 
          $array_content = array(include 'sites.txt');
          header("location: ".$array_content[rand(0,9)]);
      ?&gt; 
  </code></pre>
  
  <p>sites.txt, the file I am including</p>
  
  <pre><code>    "http://www.nsa.gov/"
      ,"http://www.youtube.com/watch?v=oHg5SJYRHA0"
      ,"http://leekspin.com/"
  </code></pre>
  
  <p>Is there a way to just insert the text file into index.php, without printing it to the screen?</p>