Reputation: 515
I m using the php function file_get_contents to parse a php file. But it seems that as soon as it is reading the php tags the file_get_contents is malfunctioning.
I checked the function with a normal text file, its functioning perfectly. But even if it finds php tags in a text file, the file is being half read. How can i find a way to get the full contents.
Upvotes: 1
Views: 3004
Reputation: 1696
Is the file local? Or are you trying to get a remote file? How did you check that the content is not read? Echoing it to a browser might trick you because of the <
char in <?php
Use htmlspecialchars
or <pre>
to view the whole text. Or just look at the source of the page.
Upvotes: 3