i want to replace \\
with \
in PHP i tried this code but it doesn't work any idea ?
$var= preg_replace('/\\\\/', "\\", $var);
thanks a lot
i want to replace \\
with \
in PHP i tried this code but it doesn't work any idea ?
$var= preg_replace('/\\\\/', "\\", $var);
thanks a lot
Use stripcslashes() or stripslashes() instead. There is no good reason for regular expressions here and on the other hand they are more expensive than the built-in functions.