1.
<?php
2.
htmlspecialchars(
$string
)
3.
?>
Quote: The translations performed are: * '&' (ampersand) becomes '&' * '"' (double quote) becomes '"' when ENT_NOQUOTES is not set. * ''' (single quote) becomes ''' only when ENT_QUOTES is set. * '<' (less than) becomes '<' * '>' (greater than) becomes '>'
$new
= htmlspecialchars(
"<a href='test'>Test</a>"
, ENT_QUOTES);
echo
;
// <a href='test'>Test</a>
4.
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท