« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 2 of about 2 for convmap (0.001 sec.)
mb_encode_numericentity — 文字を HTML 数値エンティティにエンコードする | PHP 8.... 11228
mb_encode_numericentity (PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8) mb_encode_numericentity — 文字を HTML 数値エンティティにエンコードする 説明 function mb_encode_numericentity ( string $string , array $map , ? string $encoding = null , bool $hex ... ローするようになりました。 これより前のバージョンでは、 E_WARNING が発生し、 false を返していました。 例 例1 map の例 <?php $convmap = array( int start_code1 , int end_code1 , int offset1 , int mask1 , int start_code2 , int end_code2 , int offset2 , int m ... numericentity() の例 <?php $str = "aAæÆあア?" ; /* 4 バイトまでのすべての UTF-8 文字を HTML 数値エンティティに変換する */ $convmap = [ 0 , 0x1FFFFF , 0 , 0x10FFFF ]; var_dump ( mb_encode_numericentity ( $str , $convmap , "utf8" )); /* 2 バイトと 4 バイト ... の UTF-8 文字だけを HTML 数値エンティティに変換する */ $convmap = [ 0x80 , 0x7FF , 0 , 0x10FFFF , 0x10000 , 0x1FFFFF , 0 , 0x10FFFF , ]; var_dump ( mb_encode_numericentity ( $str , $conv ...
https://man.mtool.work/php/8.3/function.mb-encode-numericentity.html
mb_decode_numericentity — HTML 数値エンティティを文字にデコードする | PHP 8.3 7485
mb_decode_numericentity (PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8) mb_decode_numericentity — HTML 数値エンティティを文字にデコードする 説明 function mb_decode_numericentity ( string $string , array $map , ? string $encoding = null ): string 文字 ... ローするようになりました。 これより前のバージョンでは、 E_WARNING が発生し、 false を返していました。 例 例1 map の例 <?php $convmap = array( int start_code1 , int end_code1 , int offset1 , int mask1 , int start_code2 , int end_code2 , int offset2 , int m ... } else { $encoded .= mb_convert_encoding ( hex2bin ( $u ), 'UTF-8' , 'UTF-32' ); } } return $encoded ; } // テストデータ $convmap = [ 0x0 , 0xffff , 0 , 0xffff ]; $msg = '' ; for ( $i = 0 ; $i < 1000 ; $i ++) { // chr() では 128 より大きい UTF-8 データ ... を正しく生成できないので、mb_decode_numericentity() を使います $msg .= mb_decode_numericentity ( '&#' . $i . ';' , $convmap , 'UTF-8' ); } // var_dump($msg); var_dump ( escape_javascript_string ( $msg )); ?> 参考 mb_encode_numericentity() - 文字を ...
https://man.mtool.work/php/8.3/function.mb-decode-numericentity.html
PREV 1 NEXT