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' &lt;b&gt;bold&lt;/b&gt; echo htmlentities($str); 

but, output in browser not expected. mean in browser it's not replaced <b> &lt;b&gt;

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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -