有没有更好的方法来做到这一点?:
$dataString2 = " $leder klarte orgkrim å fikk: ".$showcah." den ".$timed." ";
$dataString3 = " $hacker klarte orgkrim å fikk: ".$showcah." den ".$timed." ";
$dataString4 = " $driver klarte orgkrim å fikk: ".$showcah." den ".$timed." ";
$dataString5 = " $weaponexpert klarte orgkrim å fikk: ".$showcah." den ".$timed." ";
$dataStringinfo = "$leder, $hacker, $driver, $weaponexpert klarte å OC med å få ".$showcah." tid: ".$timed."";
$dataStringinfo .= "\n";
$dataString2 .= "\n";
$dataString3 .= "\n";
$dataString4 .= "\n";
$dataString5 .= "\n";
$fWrite0 = fopen("/home/nordic/www/logger/orgkrim/completed/oversikt.txt","a");
$fWrite1 = fopen("/home/nordic/www/logger/orgkrim/oversikt.txt","a");
$fWrite2 = fopen("/home/nordic/www/logger/orgkrim/completed/$leder.txt","a");
$fWrite3 = fopen("/home/nordic/www/logger/orgkrim/completed/$hacker.txt","a");
$fWrite4 = fopen("/home/nordic/www/logger/orgkrim/completed/$driver.txt","a");
$fWrite5 = fopen("/home/nordic/www/logger/orgkrim/completed/$weaponexpert.txt","a");
$wrote2 = fwrite($fWrite2, $dataString2);
$wrote2 = fwrite($fWrite3, $dataString3);
$wrote3 = fwrite($fWrite4, $dataString4);
$wrote4 = fwrite($fWrite5, $dataString5);
$wrote5 = fwrite($fWrite1, $dataStringinfo);
$wrote0 = fwrite($fWrite0, $dataStringinfo);
fclose($fWrite0);
fclose($fWrite1);
fclose($fWrite2);
fclose($fWrite3);
fclose($fWrite4);
fclose($fWrite5);
简而言之,这会将各种“日志”发送到不同的地方。我想知道这里是否有更简单的方法可以节省空间。