I want to echo out the php code itself for educational purposes. Is this possible? At the same time I also need the code as php code to be executed.
adding html special-chars to this:
$this->art = file_get_contents("$this->Mainpage/$this->dir/$this->article");
it becomes:
$this->Art = htmlspecialchars( file_get_contents("$this->Mainpage/$this->dir/$this->Artikel"));
But this still does not output the code itself as the php interpreter seems to get hold of the code and directly interprets it. htmlspecialchars () has only got an effect on the html code, you then get to see the article in brackets.
I also tried using .html files instead of .php files. But PHP interprets it even if you rename it to .jpeg.
I'm at my wit's end. I would be grateful for any answer. Thanking in advance.
file_get_contentsdoesn't interpret any PHP, there's something else going on here. What's actually in the file in question?str_replace('<?php','',$yourdata);