programing

htmlentity()를 되돌리는 방법?

instargram 2023. 10. 14. 09:33
반응형

htmlentity()를 되돌리는 방법?

아이같은 특별한 캐릭터는 제가 전화할 수 있습니다.htmlentities():

$mycaption = htmlentities($mycaption, ENT_QUOTES);

해당 html 엔티티를 가져오려면:

áéí

이걸 어떻게 다시 á이로 돌릴 수 있죠?

사용하는 경우htmlentities()인코딩하려면 다음을 사용할 수 있습니다.html_entity_decode()프로세스를 반전시키는 방법:

html_entity_

모든 HTML 엔티티를 해당 문자로 변환합니다.

html_entity_decode()는 문자열의 모든 HTML 엔티티를 해당 문자로 변환한다는 점에서 htmlenties()와 반대입니다.

예.

$myCaption = 'áéí';

//encode
$myCaptionEncoded = htmlentities($myCaption, ENT_QUOTES);

//reverse (decode)
$myCaptionDecoded = html_entity_decode($myCaptionEncoded);

html_entity_decode를 보고 어떤 문자 집합을 사용해야 하는지 고민하려고 합니다(아마도 ISO8859-1).

캐릭터 세트 등에 관한 이 기사를 읽어볼 가치도 있을 것입니다.

찾으시는 것 같네요.

html_entity_decode()html_entity_decode()이는 다음에 대한 문서의 맨 처음에서 찾을 수 있습니다.

string html_entity_decode ( string $string [, int $quote_style = ENT_COMPAT [, string $charset = 'UTF-8' ]] )

언급URL : https://stackoverflow.com/questions/6465263/how-to-reverse-htmlentities

반응형