doude1917 2012-02-22 04:42
浏览 392
已采纳

我如何从PHP中的字符串中删除双引号?

I've been trying to solve this but no luck. This is my code.

       $replace1 =str_replace('hreflang=\"'.$arr['variantslang1hid'].'\"     lang=\"'.$arr['variantslang1hid'].'\"','hreflang=\"'.$arr['variantslang1'].'\" lang=\"'.$arr['variantslang1'].'\"',$replace1);

It should replace but no. I'm not escaping "" properly. How can i solve this? Help much appreciated!

  • 写回答

1条回答 默认 最新

  • duanba8173 2012-02-22 04:47
    关注

    if you use single quotes, you don't need to escape double quotes, '"' is what you want.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?