title: PHP exec returns "array" instead of the result of my command
body: <p>I'm trying to build a web terminal emulator on my local webserver (openwrt), every time I execute the command, the result always says "array", for instance when I execute <code>uptime</code> it doesn't give me the up time of my webserver but instead it gives me <code>array</code>. This is my script:</p>
  
  <pre><code>&lt;?php
  ..............................
  if($_POST['command'])
  {
  $command = $_POST['command'];
  exec("$command 2&gt;&amp;1 &amp;", $output);
  echo $command;
  }
  echo "&lt;form action=\"".$PHP_SELF."\" method=\"post\"&gt;";
  echo "Command:&lt;br&gt;&lt;input type=\"text\" autofocus name=\"command\" size=\"15\" value=\"\"/&gt;&lt;br&gt;";
  echo '&lt;br&gt;Result :&lt;br&gt;&lt;pre&gt;
          &lt;div id="show" style="font-size: 11px;  word-wrap: break-word; width:550px;height:200px;border:0px solid #000;text-align:left; overflow-y: scroll;"&gt;
          '.$output.'&lt;/div&gt;';
  echo '&lt;input type="submit" name="kill" value="Kill Command" /&gt;';
  echo "&lt;/form&gt;&lt;/div&gt;";
  .........................
  ?&gt;
  </code></pre>
  
  <p>I want the <code>$output</code> to return the result of my command.
  Right now, the <code>$output</code> always returns <code>array</code> no matter what type of command I execute, how should I fix this?</p>