Found one option (a workaround). PHP ssh2_exec channel exit status?
The below code worked for me, serves my purpose:
$command .= ';echo "[return_code:$?]"';
$output = $ssh->exec($command);
preg_match( '/\[return_code:(.*?)\]/', $output, $match );
$return_code = $match[1];
echo "\r\n". $output;
echo "\r\n".$return_code;
Thanks everyone for your inputs. Appreciate it!!