I am trying to display the content of a file that contains both php code and html code into a textarea. I did
<textarea name='codemodifier' cols='110' rows='35' id='codemodifier' class='form-control' style='height: 75vh;'><?php echo file_get_contents("myfile.php"); ?></textarea>
However instead of it displaying only the content of the file, it displays other html codes under the textarea
I edited my code and did
<textarea name='codemodifier' cols='110' rows='35' id='codemodifier'
class='form-control' style='height: 75vh;'><?php echo
htmlspecialchars(file_get_contents("myfile.php")); ?></textarea>
And then nothing shows anymore in the textarea. I get the same problem when i use htmlentites instead of htmlspecialchars.
How to display content of a php and html file into a textarea ?