我收到了警告.
警告:fopen(76561197992146126 .txt):无法打开流:第6行的C:\ wamp\www\Download\t3.php中的参数无效
对于任何想知道的人,这是下面的main.txt的内容(http://pastebin.com/53chSRRz)
<?php
$APIkey = 'APIKeyHere';
$file = file('C:\wamp\www\Download\main.txt');
foreach ($file as $link) {
$link2 = "http://api.steampowered.com/ITFItems_440/GetPlayerItems/v0001/?key=" . $APIkey . "&SteamID=" . $link . "&format=json";
$downloaded = file_get_contents($link2);
$fh = fopen($link . ".txt", "a"); //or die("can't open file");
fwrite($fh, $downloaded);
}
echo "Finished";
?>
Run Code Online (Sandbox Code Playgroud)
如果我用"静态文件名"替换"fopen($ link.".txt","a")",它就可以了.但我需要$ link作为文件名.我的设置势在必行.
我使用WAMP 2.2和PHP 5.4.3运行Windows 7 x64