title: Uploading multiple files using PHP via curl
body: <p>I am trying to transfer two files via PHP using cURL. I know the methodology via the command line would be</p>
  
  <pre class="lang-bsh prettyprint-override"><code>curl -T "{file1,file2,..filex}" ftp://ftp.example.com/ -u username:password
  </code></pre>
  
  <p>And within php you can upload 1 file via the following code</p>
  
  <pre><code>$ch = curl_init();
  $localfile = "somefile";
  $username = "Someusername@someserver.com";
  $password = "somerandomhash";
  $fp = fopen($localfile, 'r');
  curl_setopt($ch, CURLOPT_URL, "ftp://ftp.domain.com/");
  curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
  curl_setopt($ch, CURLOPT_UPLOAD, 1);
  curl_setopt($ch, CURLOPT_INFILE, $fp);
  curl_setopt($ch, CURLOPT_INFILESIZE, filesize($localfile));
  curl_exec ($ch);
  $error_no = curl_errno($ch);
  curl_close ($ch);
  </code></pre>
  
  <p>But how would I do multiple files using the above methodology?</p>