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.
index.php, the file I am working with
<?php
$array_content = array(include 'sites.txt');
header("location: ".$array_content[rand(0,9)]);
?>
sites.txt, the file I am including
"http://www.nsa.gov/"
,"http://www.youtube.com/watch?v=oHg5SJYRHA0"
,"http://leekspin.com/"
Is there a way to just insert the text file into index.php, without printing it to the screen?