mb_encode_numericentity
문자를 HTML 숫자 문자열 참조로 인코딩합니다
함수 이름 : mb_encode_numericalentity ()
해당 버전 : PHP 4> = 4.0.6, PHP 5, PHP 7
함수 설명 : 문자열의 비 ASCII 문자 인코딩 문자
용법:
string mb_encode_numericentity ( string $str , array $convmap , string $encoding = mb_internal_encoding() , bool $is_hex = false ): string
매개 변수 :
반환 값 : 인코딩 된 문자열.
예:
$str = "Hello, 世界!"; $convmap = array(0x80, 0x10FFFF, 0, 0xFFFD); $encoded_str = mb_encode_numericentity($str, $convmap, 'UTF-8', true); echo $encoded_str;
산출:
Hello, 世界!
위의 예에서, 우리는 "Hello, World!" 16 진 문자 실체로서. 캐릭터 "세계"의 16 진 코드는 4E16이고, 캐릭터 "세계"의 16 진 코드는 754C이므로 출력 결과는 "Hello, World!"입니다.