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 escape characters using php..I do not want to use stripslashes since it is server dependent..
I want to remove the '\' before the '\vct=140' and the '\' before '\Arai....' How can I remove them from the s开发者_开发知识库tring?
As far as I can tell stripslashes
works as per the manual:
<?php
$string = '\\\\vct=140\\\\Araignée du soir espoir.';
echo $string, "\n";
echo stripslashes($string), "\n";
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.
精彩评论