src/PTel.php
public function expect($str, $cmd, $newline = true, $maxtimeout = 10) {
        if ($this->waitFor($str, $maxtimeout)) {
            $this->send($cmd, $newline);
            return true;
        }
    }
public function expect($str, $cmd, $newline = true, $maxtimeout = 10) {
        if ($this->waitFor($str, $maxtimeout)) {
            $this->send($cmd, $newline);
            return true;
        }
    }
public function expect ( $ str , $ cmd , $ newline = true , $ maxtimeout = 10 ) { if ( $ this -> waitFor ( $ str , $ maxtimeout ) ) { $ this -> send ( $ cmd , $ newline ) ; return true ; } }
Search for given occurance and send given command if found

@param    string  $str        String/regexp for search
@param    string  $cmd        Command to send
@param    bool    $newline    Send new line character
@param    int     $maxtimeout Maximum timeout for waiting sought string

@throws   SocketClientException   On socket communication error
@throws   TelnetException         If wait timeout is reached
@return   bool    True on search and send success, false otherwise
Search for given occurance and send given command if found