我有这个简单的 PHP 变量:
$Title = $_POST['text'];
当它有这个输入时:here's the text
PHP 将在写入文件时识别为:here\'s the text
$Filename = 'index.php';
$Handle = fopen($Filename, "r");
$Contents = fread($Handle, filesize($Filename));
fclose($Handle);
$TitleTag = extractor($Contents, "<title>", "</title>");
$Contents = str_replace ($TitleTag, $Title, $Contents);
$Handle = fopen($Filename, 'w+');
fwrite($Handle, $Contents);
fclose($Handle);
如何得到与用户输入的完全一样的内容?谢谢