我正在尝试将一些简单的文本写入文本文件但写入不起作用,下面是我正在使用的代码:请问代码有什么问题?
<?php
// create short variable names
$tireqty = 24;
$oilqty = 34;
$sparkqty = 12;
echo "<p>Your order is as follows: </p>";
echo $tireqty." tires<br />";
echo $oilqty." bottles of oil<br />";
echo $sparkqty." spark plugs<br />";
@ $fp=fopen("/order.txt","w");
if(!$fp){
echo "The file is not exists";
exit;
}
$outputstring = $date.'\t'.$tireqty.' tires \t'.$oilqty.' oil\t'
.$sparkqty.' spark plugs\t\$'.$totalamount.'\t'. $address.'\n';
fwrite($fp, $outputstring);
fclose($fp);
echo "Order have written into order.txt";