what is the difference between htmlentities and htmlspecialchars?
htmlentities — Convert all applicable characters to HTML entities
htmlspecialchars — Convert special characters to HTML entities
$str = "PHP interview questions and answers collection is good";
echo htmlentities($str);
// Outputs: PHP interview questions and answers collection is <b>bold</b>
$new = htmlspecialchars("Test", ENT_QUOTES);
echo $new; // <a href='test'>Test</a>
Thursday, April 1, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment