位置: 编程技术 - 正文
推荐整理分享PHP:mb_encode_numericentity()的用法_mbstring函数,希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
(PHP 4 >= 4.0.6, PHP 5)
mb_encode_numericentity — Encode character to HTML numeric string reference
说明 string mb_encode_numericentity ( string $str , array $convmap [, string $encoding = mb_internal_encoding() [, bool $is_hex = FALSE ]] )Converts specified character codes in string str from character code to HTML numeric character reference.
参数str
The string being encoded.
convmapconvmap is array specifies code area to convert.
encodingencoding参数为字符编码。如果省略,则使用内部字符编码。
is_hex返回值
The converted string.
更新日志版本 说明 5.4.0 Added is_hex parameter.
范例
Example #1 convmap example
<?php$convmap=array(intstart_code1,intend_code1,intoffset1,intmask1,intstart_code2,intend_code2,intoffset2,intmask2,........intstart_codeN,intend_codeN,intoffsetN,intmaskN);//SpecifyUnicodevalueforstart_codeNandend_codeN//AddoffsetNtovalueandtakebit-wise'AND'withmaskN,then//itconvertsvaluetonumericstringreference.?> 范例
Example #2 mb_encode_numericentity() example
<?php/*ConvertLeftsideofISO--1toHTMLnumericcharacterreference*/$convmap=array(0x,0xff,0,0xff);$str=mb_encode_numericentity($str,$convmap,"ISO--1");/*ConvertuserdefinedSJIS-wincodeinblock-tonumericstringreference*/$convmap=array(0xe,0xee,0x,0xffff,0xef,0xe0bb,0x,0xffff,0xe0bc,0xe0fa,0x,0xffff,0xe0fb,0xe,0x,0xffff,0xe,0xe1b6,0xc8,0xffff,0xe1b7,0xe,0xc9,0xffff,0xe,0xe,0xc,0xffff,0xe,0xe2ef,0xd,0xffff,0xe2f0,0xee,0x,0xffff,0xef,0xe3ab,0x,0xffff);$str=mb_encode_numericentity($str,$convmap,"sjis-win");?> 参见mb_decode_numericentity() - 根据 HTML 数字字符串解码成字符
PHP:mb_regex_set_options()的用法_mbstring函数 mb_regex_set_options(PHP4=4.3.0,PHP5)mb_regex_set_optionsSet/Getthedefaultoptionsformbregexfunctions说明stringmb_regex_set_options([string$options=mb_regex_set_options()])Setsthedefaultoptionsdescri
PHP:mb_regex_encoding()的用法_mbstring函数 mb_regex_encoding(PHP4=4.2.0,PHP5)mb_regex_encodingSet/Getcharacterencodingformultibyteregex说明mixedmb_regex_encoding([string$encoding=mb_regex_encoding()])Set/Getcharacterencodingforamultibyterege
PHP:mb_ereg_match()的用法_mbstring函数 mb_ereg_match(PHP4=4.2.0,PHP5)mb_ereg_matchRegularexpressionmatchformultibytestring说明boolmb_ereg_match(string$pattern,string$string[,string$option=msr])Aregularexpressionmatchforamultibytestring
标签: PHP:mb_encode_numericentity()的用法_mbstring函数
本文链接地址:https://www.jiuchutong.com/biancheng/275031.html 转载请保留说明!友情链接: 武汉网站建设