# Reading a text file - need help

**URL:** <https://forum.kirupa.com/t/reading-a-text-file-need-help/238188>\
**Category:** Uncategorized\
**Created:** [September 7, 2007, 11:48pm UTC](https://forum.kirupa.com/t/reading-a-text-file-need-help/238188 "2007-09-07T23:48:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![n2dweb](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@n2dweb](https://forum.kirupa.com/u/n2dweb)\
**Post date:** [September 7, 2007, 11:48pm UTC](https://forum.kirupa.com/t/reading-a-text-file-need-help/238188/1 "2007-09-07T23:48:36Z")

</div>

In php am reading a file with the following text:

* * *

\<p\>test\</p\>  
[FONT=Arial Black]\<?php include(“include/newlyaddeditems.php”);?\>[/FONT]  
\<table width=“100%”\>\<tr\>\<td height=“77” align=“center”\>\<p\>  
\<a href=“new.php”\>\<b\>View All of our new items\</b\>\</a\>\</p\>  
\</td\>\</tr\>\</table\>

* * *

using the php code below:

* * *

\<?php  
// file example 1: read a text file into a string with fgets  
//  
$filename= ‘hpl.txt’ ;  
$output="";  
$file = fopen($filename, “r”);  
while(!feof($file)) {  
//read file line by line into variable  
$output = $output . fgets($file, 4096);  
}  
fclose ($file);  
echo $output;

* * *

the echo $output gives me all the text except for the php include line.  
Why? and can someone please help!👽  
Thanks J
