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.
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.