PHP를 사용하여 텍스트 파일에 쓰는 웹 사이트를 개발하고 있습니다. 올바른 파일 경로에 'newfile.txt'라는 텍스트 문서를 만들었고 Chrome에서 코드를 실행했습니다. 이 파일은에 기록되지 않으며 광산과 다른 코드를 온라인에서 찾을 수 없습니다. 오류 메시지도 나타나지 않습니다. 나는 무엇을 잘못 했는가?PHP - 파일 쓰기가 작동하지 않습니다.
<!DOCTYPE html>
<html>
<body>
<?php
$myfile = fopen("C:\Users\Andrew\Documents\newfile.txt", "w") or die("Unableto open file!");
$txt = "John Doe\n";
fwrite($myfile, $txt);
$txt = "Jane Doe\n";
fwrite($myfile, $txt);
fclose($myfile);
?>
</body>
</html>
하지만 오류를 찾고 계십니까? ['error_reporting (E_ALL);'] (http://php.net/manual/en/function.error-reporting.php) ['ini_set ('display_errors', 1);'] (http : // php .net/manual/en/function.ini-set.php) – Qirel