How can I remove escape characters using PHP?

前端 未结 1 746
独厮守ぢ
独厮守ぢ 2021-01-18 18:10

I have the following text

$text = \"\\\\vct=140\\\\Araignée du soir espoir,araignée du matin,espoir du matin.\"

I want to remove the esc

1条回答
  •  情歌与酒
    2021-01-18 19:09

    As far as I can tell stripslashes works as per the manual:

    Which outputs:

    \\vct=140\\Araignée du soir espoir.
    \vct=140\Araignée du soir espoir.
    

    Sequence \\ is in list of escape sequences for special characters so you got to escape slashes twice.

    0 讨论(0)
提交回复
热议问题