title: What's the difference between escapeshellarg and escapeshellcmd?
body: <p>PHP has 2 closely related functions, <a href="http://php.net/escapeshellarg" rel="noreferrer"><code>escapeshellarg()</code></a> and <a href="http://php.net/escapeshellcmd" rel="noreferrer"><code>escapeshellcmd()</code></a>. They both seem to do similar things, namely help make a string safer to use in <code>system()</code>/<code>exec()</code>/etc.</p>
  
  <p>Which one should I use? I just want to be able to take some user input and run a command on it, and not have everything blow up. If PHP had an exec-type-function that took an array of strings (like argv), which bypasses the shell, I'd use that. Similar to Python's <a href="http://docs.python.org/library/subprocess.html#convenience-functions" rel="noreferrer"><code>subprocess.call()</code></a> function.</p>