可以使用str_replace或preg_replace來達成,
而preg_replace則必需撰寫常規式,
示範程式碼如下示:
$str=\'link\';
$str_2=str_replace(\'\"\',\'\',$str);
$str_3=preg_replace(\'/[\"]?/\',\'\',$str);
?>
雙引號會變\\的問題,
請您先確認您的php.ini的設定magic_quotes_gpc是否為on,
如果是,
請改成off,
因為問題有可能是出現在您的PHP的設定
|