html_entity_decode 함수
html_entity_decode 함수는
HTML 엔티티를 해당 문자로 변환합니다.
더 나은 이해를 위해 예제를 참조하세요.
구문
html_entity_decode(string $string, int $flags = ENT_COMPAT, ?string $encoding = null): string
예제
태그가 포함된 문자열을 변환해 봅시다:
<?php
$str = '<b>text</b>';
$res = html_entity_decode($str);
echo $res;
?>
코드 실행 결과:
'<b>text</b>'
예제
엠퍼샌드(&)가 포함된 문자열을 변환해 봅시다:
<?php
$str = 'test: &';
$res = html_entity_decode($str);
echo $res;
?>
코드 실행 결과:
'test: &'
함께 보기
-
역방향 작업을 수행하는 함수
htmlentities -
유사한 역방향 작업을 수행하는 함수
htmlspecialchars