I want to print following text as it is:
echo \"
But it is just showing \'AAAAA\' as output.
How can I esca
Use the htmlentities() function to convert into a plain text string.
<?php
echo htmlentities("<label> AAAAA");
?>
echo htmlentities("<label> AAAAA");
Use htmlspecialchars.
<?php
echo htmlspecialchars("abc & < >");
?>
You should escape your especial characters for HTML.
echo "<label> AAAA"
http://www.w3schools.com/tags/ref_entities.asp
echo "<label> AAAAA";
Use HTML entities: <
for <
and >
for >
. Could be achieved using htmlspecialchars
function: http://php.net/htmlspecialchars.
Read more about HTML entities here: http://www.santagata.us/characters/CharacterEntities.html