폴더 디렉토리 이름 "code"를 만들려고했으며 "status.txt"에 저장하려고합니다.예기치 않은 T_CONSTANT_ENCAPSED_STRING 수신, 디렉토리 생성
예기치 않은 T_CONSTANT_ENCAPSED_STRING이 (가) 수신 된 코드 문제입니다.
if(is_writeable($newdir . "/status.txt")) {
if (fwrite($statusTxt, $statusCode . "," . $status . "," . $share . "," . $date . "," . $permission "\n")){
}
이 방법으로 디렉토리를 생성하여 status.txt에 저장합니까? 다음은 나머지 코드입니다.
감사합니다. 도움을 주셔서 감사합니다.
$newdir = "../../data/code";
umask(0007);
if(!file_exists($newdir))
{
mkdir($newdir, 02770);
$statusTxt = fopen($newdir. "/status.txt", "a");
}
if(is_writeable($newdir . "/status.txt")) {
if (fwrite($statusTxt, $statusCode . "," . $status . "," . $share . "," . $date . "," . $permission "\n")){
}
echo "<p>Your form has succesfully been submit!</p>";
}
fclose($statusTxt);
}
fwrite 호출에서 마지막'\ n '앞에'.'가 없습니다. – andrewsi