(PECL expect >= 0.1.0)
Waits until the output from a process matches one of the patterns, a specified time period has passed, or an EOF is seen
int expect_expectl ( resource $expect, array $cases [, array &$match ] )
Waits until the output from a process matches one of the patterns, a specified time period has passed, or an EOF is seen.
If match is provided, then it is filled with the result of search. The matched