title: What does 2>&1 do in this php snippet?
body: <p>Regarding this code</p>
  
  <pre><code>public function invoke($url)
  {
      exec('wget 2&gt;&amp;1', $output);
      print_r($output);
  }
  </code></pre>
  
  <p>What does the <code>2&gt;&amp;1</code> do in this command?  I found this on SO but the <code>2&gt;&amp;1</code> was not explained</p>
  
  <p><code>wget</code> is a linux command and I'm running it from PHP using <code>exec()</code>.</p>
  
  <p>The code above works.  I just need to insert the <code>$url</code> in the correct place and understand the <code>2&gt;&amp;1</code>.</p>
  
  <p><strong>Related Links</strong></p>
  
  <p><a href="http://www.gnu.org/software/wget/" rel="nofollow">GNU Documentation on Wget</a></p>