텍스트 파일에 변수를 쓰는 스크립트가 있습니다. fwrite()를 사용하고 있습니다. 5626_Report :PHP에서 fwrite()를 사용하여 여러 변수를 작성하는 방법은 무엇입니까?
1.As 내가 예를 들어 BATCH_ID를 사용하여 접두사와 각 보고서의 텍스트 파일 이름을 지정할 BATCH_ID에 의해 보고서가 나타납니다 내가 여기에이 문제가
<?php
error_reporting(E_ALL^E_NOTICE);
$filename = 'Report.txt';
$batch_id = $_GET['batch_id'];
$status = $_GET['status'];
$phone_number = $_GET['phone_number'];
//check to see if I could open the report.txt
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
// I am trying to write each variables to the text file
if (fwrite($handle, $phone_number) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "Success, wrote ($phone_number) to file ($filename)";
fclose($handle);
?>
: 여기에 스크립트입니다. txt
2. fwrite() 함수에 둘 이상의 변수를 전달하려면 각 $ phone_number 옆에 $ status를 쓰고 싶습니다.
. 도움을 구하는데도 부끄러운 일이 없습니다. 그러나 다른 사람들이 당신을 위해 당신의 문제를 해결하려고 노력하지도 않는 것에 부끄러움이 있습니다. 나는 네가 여기서 그 일을했다고 생각하지 않는다. 그러므로 네 질문에 투표 할 이유가 없다. – ATaylor