Tuesday, 15 May 2012

Showing a literal string with PHP -



Showing a literal string with PHP -

i set in single quotes in echo, , &lt, etc. gets turned appropriate characters. not display literally, &lt , etc.

how do it? thanks.

you need utilize htmlspecialchars function

<?php echo "&lt&gt"; //will display <> echo htmlspecialchars ("&lt&gt", ent_quotes,'utf-8'); //will display &lt&gt ?>

php

No comments:

Post a Comment