title: How to get exit status of PHP ssh2_exec command?
body: <p>I want to get the exit status of ssh2_exec command.I tried following code but it it is giving me the output of jar file but i want only the status for success or failure.How can i get that, please help.</p>
  
  <pre><code>$stream = ssh2_exec($connection, 'path of jar file');
  stream_set_blocking($stream,true);
  $output = ssh2_fetch_stream($stream,SSH2_STREAM_STDIO);
  echo stream_get_contents($output);
  </code></pre>