stream = ssh2_exec($link, $cmd); stream_set_blocking($this->stream, true); } $line = ''; while($get = fgets($this->stream)) $line.= $get; return $line; } public function disconnect($link) { ssh2_exec($link, "exit"); } } ?>