title: PHP Net_SSH2 - exec() how to get the command return code
body: <p>How can I get the return code for the command that is executed :</p>
  
  <pre><code>&lt;?php
  include('Net/SSH2.php');
  
  $ssh = new Net_SSH2('www.domain.tld');
  if (!$ssh-&gt;login('username', 'password')) {
      exit('Login Failed');
  }
  
  echo $ssh-&gt;exec('cat /tmp/file_tmp');
  //verify the return code
  echo $ssh-&gt;exec('echo $?');
  
  ?&gt;
  </code></pre>
  
  <p><code>echo $?</code>(Linux) and <code>echo %errorlevel%</code>(Win) don't work.</p>
  
  <p>Any Ideas??</p>