|
PHP5中文手册
expect_expectl(PECL expect:0.1-0.2.2) expect_expectl — 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 string can be found in match[0] . The match substrings (according to the parentheses) in the original pattern can be found in match[1] , match[2] , and so on, up to match[9] (the limitation of libexpect). 参数
返回值Returns value associated with the pattern that was matched. On failure this function returns: EXP_EOF, EXP_TIMEOUT or EXP_FULLBUFFER 更新日志
范例
Example#1 expect_expectl() example
<?php |