例如
我用
$content = nl2br($_POST['content']);
当我在我的表格中输入这样的内容时
"I'll be going to the office today"
它会回来的
"I\'ll be going to the office today"
有没有办法可以删除\'s?还是我使用的 nl2br 功能有误?
例如
我用
$content = nl2br($_POST['content']);
当我在我的表格中输入这样的内容时
"I'll be going to the office today"
它会回来的
"I\'ll be going to the office today"
有没有办法可以删除\'s?还是我使用的 nl2br 功能有误?
nl2br()没有这样的事情!你有魔术引号。  把它们关掉。
我猜你是通过 POST 或 GET 获取信息的;尝试这样的事情:
<?php
if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach ($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}
?>
尝试使用 stripslashes( $content )。