title: PHP Script fopen failed to open stream: > Invalid argument Error
body: <p>I am getting a warning.</p>
  
  <blockquote>
    <p>Warning: fopen(76561197992146126 .txt): failed to open stream:
    Invalid argument in C:\wamp\www\Download\t3.php on line 6</p>
  </blockquote>
  
  <p>For anyone wondering, this is the contents of main.txt below (<a href="http://pastebin.com/53chSRRz" rel="nofollow">http://pastebin.com/53chSRRz</a>)</p>
  
  <pre><code>&lt;?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 . "&amp;SteamID=" . $link . "&amp;format=json";
      $downloaded = file_get_contents($link2);
      $fh = fopen($link . ".txt", "a"); //or die("can't open file");
      fwrite($fh, $downloaded);
      }
      echo "Finished";
  ?&gt;
  </code></pre>
  
  <p>If I replace "fopen($link . ".txt", "a")" with a static file-name it works. But I need $link to be the filename. It is imperative to my setup.</p>
  
  <p>I am running Windows 7 x64 using WAMP 2.2 with PHP 5.4.3</p>