Advertisement
GAMELASTER

SSH2_SHELL_EXEC with return

Jan 7th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. /* By GAMiEE , 2012 , http://gamee.sk/ */
  2. function ssh2_shell_exec($c1,$cmd1,$enablebr = false)
  3. {
  4.     $exec = ssh2_exec($c1, $cmd1);
  5.     stream_set_blocking($exec, true);
  6.     $output = stream_get_contents($exec);
  7.     if($enablebr == false)
  8.         $output = str_replace("\n","",$output);
  9.     else if($enablebr == true)
  10.         $output = nl2br($output);
  11.     else if($enablebr == "fatal")
  12.     {
  13.    
  14.     }
  15.     fclose($exec);
  16.     //echo $output;
  17.     return $output;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement