PHP htmlentities()

Jmnote (토론 | 기여)님의 2020년 7월 6일 (월) 22:25 판 (새 문서: ==개요== ;PHP htmlentities() <source lang='php' run> $str = "A 'quote' is <b>bold</b>"; // Outputs: A 'quote' is <b>bold</b> echo htmlentities($str); </source> <source...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

PHP htmlentities()
$str = "A 'quote' is <b>bold</b>";
// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);
$str = "A 'quote' is <b>bold</b>";
// Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
$str = "\x8F!!!";
// Outputs an empty string
echo htmlentities($str, ENT_QUOTES, "UTF-8");
$str = "\x8F!!!";
// Outputs "!!!"
echo htmlentities($str, ENT_QUOTES | ENT_IGNORE, "UTF-8");

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}