このコードを使用すると、3 つのエラーが発生し続けます。
Warning: fopen() [function.fopen]: Filename cannot be empty
Warning: fwrite(): supplied argument is not a valid stream resource
Warning: fclose(): supplied argument is not a valid stream resource
どうすればいいのかわからない。私はphp初心者です。
<?php
$random = rand(1, 9999999999);
$location = "saves/".$random;
while (file_exists($location)) {
$random = rand(1, 999999999999);
$location = "saves/".$random;
}
$content = "some text here";
$fp = fopen($location,"wb");
fwrite($fp,$content);
fclose($fp);
?>