<pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>'[{&quot;out_trade_no&quot;:&quot;0224085707-3375&quot;,&quot;transaction_id&quot;:&quot;4002362001201702241094854694&quot;,&quot;out_refund_no&quot;:&quot;123&quot;,&quot;total_fee&quot;:&quot;1&quot;,&quot;refund_fee&quot;:&quot;1&quot;}]'</font> <i>(length=239)</i>
post接收到这样的值 使用了html_entity_decode 和htmlspecialchars_decode 只能去掉& 去不掉quot; 整整一天了 怎么解决 在线等
php 去html实体双引号
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- pharaoh_shi 2017-02-25 03:38关注
$str = '[{"out_trade_no":"0224085707-3375","transaction_id":"}]'; var_dump($str); $str = replaceStr($str); var_dump($str); function replaceStr($str) { // 要替换的选项 $seach = array(""", "&"); // 替换成什么 一一对应 $replace = array("\"", "\&"); return str_replace($seach, $replace, $str); }
输出结果:
string '[{"out_trade_no":"0224085707-3375","transaction_id":"}]' (length=90) string '[{"out_trade_no":"0224085707-3375","transaction_id":"}]' (length=55)
解决 无用评论 打赏 举报
悬赏问题
- ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
- ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
- ¥15 CSAPPattacklab
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 关于大棚监测的pcb板设计
- ¥15 stm32开发clion时遇到的编译问题
- ¥15 lna设计 源简并电感型共源放大器
- ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
- ¥15 Vue3地图和异步函数使用