External PHP scripts to use on multiple pages
<p>I have been searching for a while and cant seem to find what i need. I am trying to use a externa php file somewhat in the same way as .css files are used with the goal of being able to easily change features across the entire website. I have already achieved this by just using fopen() and fgets() on a normal text file with normal html scripts, but i was wondering if this was also possible with the php scripts.  Heres the code i am trying to use:
    

<pre><code>                $open=fopen("site name", "r");

                while(!feof($open)){

                $arr=explode("seperationtext1324",fgets($open));

                echo "&lt;p id='newcomment1'&gt;&lt;span class='Uname'&gt;".$arr[0]."&lt;/span&gt;".shorten_text($arr[1], 65)."&lt;br/&gt;&lt;a class='newcommentlink' href='".$arr[3]."'&gt;".$arr[2]."&lt;/a&gt;&lt;/p&gt;";

                echo "&lt;p id='newcomment2'&gt;&lt;span class='Uname'&gt;".$arr[4]."&lt;/span&gt;".shorten_text($arr[5], 65)."&lt;br/&gt;&lt;a class='newcommentlink' href='".$arr[7]."'&gt;".$arr[6]."&lt;/a&gt;&lt;/p&gt;";

                echo "&lt;p id='newcomment3'&gt;&lt;span class='Uname'&gt;".$arr[8]."&lt;/span&gt;".shorten_text($arr[9], 65)."&lt;br/&gt;&lt;a class='newcommentlink' href='".$arr[11]."'&gt;".$arr[10]."&lt;/a&gt;&lt;/p&gt;";

                echo "&lt;p id='newcomment4'&gt;&lt;span class='Uname'&gt;".$arr[12]."&lt;/span&gt;".shorten_text($arr[13], 65)."&lt;br/&gt;&lt;a class='newcommentlink' href='".$arr[15]."'&gt;".$arr[14]."&lt;/a&gt;&lt;/p&gt;";

                echo "&lt;p id='newcomment5'&gt;&lt;span class='Uname'&gt;".$arr[16]."&lt;/span&gt;".shorten_text($arr[17], 65)."&lt;br/&gt;&lt;a class='newcommentlink' href='".$arr[19]."'&gt;".$arr[18]."&lt;/a&gt;&lt;/p&gt;";}

                fclose($open);

            ?&gt;
</code></pre>
