title: Accessing an FTP directory listing with PHP
body: <p>I need to download data from the Bureau of Labor Statistics' public FTP server for analysis. I'm attempting to use PHP to retrieve a listing, but I'm not sure how to do it with a public FTP server - using no ftp_login results in "false" being returned, and attempting to login as anonymous hangs the script.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  // set up basic connection
  $ftp = ftp_connect("ftp.bls.gov");
         ftp_login($ftp, "anonymous", "");
               ftp_pasv($ftp, true);
  var_dump(ftp_rawlist($ftp, "/pub/time.series/la/"));
  ?&gt;
  </code></pre>