Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why the function "htmlentities" doesn't work?

Status
Not open for further replies.

seahorse123

Programmer
Jul 25, 2005
39
US
I found that the function "htmlentities" doesn't work on my server, for example I have the code:
Code:
<?php
$str = "A 'quote' is <b>bold</b>";
echo htmlentities($str, ENT_QUOTES);
?>
it's supposed to display:
A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;
but what I can see is:
A 'quote' is <b>bold</b>

I don't know why the function "htmlentities" doesn't work, some other functions like "htmlspecialchars()" also doesn't work, anyone knows the reason? thanks.
 
I have figured it out, it does convert but cannot be shown on the browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top