str_replace()的用法

解释:顾名思义就是替换的意思

//实例1:字符串替换字符串

1.$str=https:\/\/wx.tenpay.com\/cgi-bin\/mmpayweb-bin\/checkmweb?prepay_id=wx281711157451784a28755d16521ac60000&package=2137225471;

  $str=str_replace("\/", "/",$str);

  echo $str //输出结果:https://wx.tenpay.com/cgi-bin/mmpayweb-bin/checkmweb?prepay_id=wx281711157451784a28755d16521ac60000&package=2137225471;

观察发现,str_replace()这个功能将字符串里的"\/"转换成了"/"了

posted @ 2022-05-04 17:07  无缺胜有缺  阅读(122)  评论(0)    收藏  举报