Search code examples
phphtmlxhtmltextareafckeditor

Read file containing PHP without parsing PHP


I am using a wysiwyg editor in a web app. It is FCKeditor. In order to edit a file, other than loading javascript, my web form that edits the the file looks like this:

<textarea><?php include('myWebDoc.html') ?></textarea>

I also tried this:

<textarea><?php file_get_contents('myWebDoc.html') ?></textarea>

Both attempts end up parsing the php inside the web document before it gets to the editor.

Is there a better php function or way to get the contents of a file into the textarea tag without parsing?


Solution

  • Try readfile instead of file_get_contents.

    http://www.php.net/manual/en/function.readfile.php