htmlentities — 해당하는 모든 문자를 HTML 엔티티로 변환 정보
PHP htmlentities — 해당하는 모든 문자를 HTML 엔티티로 변환본문
htmlentities — 해당하는 모든 문자를 HTML 엔티티로 변환
string htmlentities ( string $string [, int $quote_style [, string $charset [, bool $double_encode ]]] )
htmlentities()는 HTML 문자 엔티티에 존재하는 모든 문자를 엔티티로 변환하는 점을 제외하면, htmlspecialchars()와 완전히 동일합니다.
디코드(역변환)하려면 html_entity_decode()를 사용할 수 있습니다.
<?php
$str = "A 'quote' is <b>bold</b>";
// 출력: A 'quote' is <b>bold</b>
echo htmlentities($str);
// 출력: A 'quote' is <b>bold</b>
echo htmlentities($str, ENT_QUOTES);
?>
추천
0
0
댓글 0개