replace()函数里的双引号如何处理
4 回答

冉冉说
TA贡献1877条经验 获得超1个赞
直接替换不就完了吗:
d = d.replace("\"","").replace("\"","");
如果不确定有多少个双引号:
d = d.replace(/\"/g, "");

繁星coding
TA贡献1797条经验 获得超4个赞

慕雪6442864
TA贡献1812条经验 获得超5个赞
1 | <?php $s = str_replace ( '"' , '' , $str ); ?> |
用str_replace()函数
把包含双引号“的替换掉
另一个例子你一看就懂了:
1 | <?php echo $s = str_replace ( "one" , "two" , "hello one" ); ?> |
这个输出的是hello two
添加回答
举报
0/150
提交
取消