Can't display the output result in browser returned from htmlentities() function in php -
i tried display output returned htmlentities() function. but, display nothing in browser. here code..
$advertisement = "coffee @ 'cafè française' costs $2.25."; echo htmlentities($advertisement);
the result should this:
coffee @ 'cafè française' costs $2.25.
but, there nothing displaying in browser.
when assign output in variable, it's value not null. testing code is:
$temp = htmlentities($advertisement); if($temp === null) echo "null"; else echo "not null";
then, result "not null";
i try code testing:
$str = "a 'quote' `<b>`bold`</b>`"; //outputs: 'quote' <b>bold</b> echo htmlentities($str);
but, output in browser not expected. mean in browser it's not replaced <b>
<b>
what missing? need change setting in php.ini file?
that htmlentities supposed do. echo string out , should implement html automatically.
$str = "a quote <b>bold</b>"; echo $str;
Comments
Post a Comment