title: Parameter passed by PHP via command line gets truncated
body: <p>I am using PHP's <code>shell_exec()</code> to execute a program via a commandline, passing it an URL as the parameter.</p>
  
  <p><strong>Problem:</strong> The program seem to receive only a truncated version of the parameter. PHP passes the parameter </p>
  
  <p><code>http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616&amp;parentID=-1&amp;pge=0&amp;pgeSize=200&amp;sort=1</code></p>
  
  <p>but the program receives it as</p>
  
  <pre><code>http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616
  </code></pre>
  
  <p>How can I prevent it from getting truncated after the <code>&amp;</code>?</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>    $url = 'http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616&amp;parentID=-1&amp;pge=0&amp;pgeSize=200&amp;sort=1';
      $script = path('base')."application/phantomjs/httpget.js";
      $output = shell_exec("phantomjs $script $url");
  </code></pre>
  
  <p><strong>httpget.js</strong></p>
  
  <pre><code>// Get URL from command line parameter
  var system = require('system');
  var url = system.args[1];
  console.log(url);
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p><code>http://www.mysite.com/Men/T-Shirts-Vests/Cat/pgecategory.aspx?cid=7616</code></p>