I have HTML tags present inside php variable. I want to print the values as it is. Here is what i tried.
$str = "A 'quote' is <b>bold</b>";
echo htmlentities($str);
// Outputs: A 'quote' is <b>bold</b>
echo $str; //out puts as follows
A 'quote' is bold
But i want to print it as
A 'quote' is <b>bold</b>
Also, Is there any setting can be done at the TOP of the php page, so that i dont need to use it in every php variables ?
echo $strhtmlentities(). If you want to show the tags in the browser as literal text, you need to escape it as you are doing currently. Please clarify what you actually want to do