Prevent PHP parsing in strings [closed]

<?php echo $page->text; ?> should not be executing PHP code in $page->text. However, the PHP code inside of it may be interpreted by the browser as a processing instruction. To fix that, you’d need to escape it as HTML:

<?php echo htmlspecialchars($page->text); ?>

For more information on htmlspecialchars, see the documentation.

Browse More Popular Posts

Leave a Comment