后端开发|php教程
html,php,自定义
后端开发-php教程
<?php/** Created on -9-29**/$orig = "Ill \"walk\" the dog now";$a = htmlentities($orig);$b = html_entity_decode($a);echo $a; // Ill "walk" the <b>dog</b> nowecho $b; // Ill "walk" the dog now// For users prior to PHP 4.3.0 you may do this:function unhtmlentities($string){ // replace numeric entities $string = preg_replace(~&#x([0-9a-f]+);~ei, chr(hexdec("\\1")), $string); $string = preg_replace(~&#([0-9]+);~e, chr("\\1"), $string); // replace literal entities $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl);}$c = unhtmlentities($a);echo $c; // Ill "walk" the dog now?>
运行结果下图例:
智能微课系统源码,退役手机刷ubuntu,tomcat打开跳转到百度,爬虫链接标签怎么,php自定义常量的正确语句,罗定seo推广lzw
人人商城源码3.9.78,ubuntu重新识别网卡,七麦网站爬虫,php7的php-fpm,盐城企业seolzw
如果觉得《php使用自定义函数转换html标签办法》对你有帮助,请点赞、收藏,并留下你的观点哦!