找到 \ 反斜杠并将其从 sting php 中删除

find \ back slash and remove it from sting php

我在从字符串

中替换 \ 时遇到问题
 <?php   $postlink = str_replace( "\" , '', $postlink); ?>

那行有什么问题 Dreamweaver 告诉我那行错了

\ 是您需要使用的特殊字符 \

<?php
$postlink = str_replace( "\" , '', $postlink); 
?>

您也可以使用stripslashes() for removing slash, why are you str_replace()? if you have only backslashes than use stripslashes()

示例:

echo stripcslashes("it\'s working day!"); //it's working day!