Remove all backslashes from PHP urldecoded string

后端 未结 5 1142
悲哀的现实
悲哀的现实 2021-01-18 05:03

I am trying to remove all backslashes from a url-decoded string, but it is outputting \\ rather than outputting the url-decoded string with \\ removed.

Please can yo

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-18 05:32

    Accoring to php.net's str_replace docs, the first argument is what you are searching for, the second is what you are replacing with, and the third is the string you are searching in. So, you are looking for this:

    str_replace("\\","", $json)
    

提交回复
热议问题