array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.expect-popen.php', 1 => 'expect_popen', ), 'up' => array ( 0 => 'ref.expect.php', 1 => 'Expect 関数', ), 'prev' => array ( 0 => 'function.expect-expectl.php', 1 => 'expect_expectl', ), 'next' => array ( 0 => 'book.pcntl.php', 1 => 'PCNTL', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/expect/functions/expect-popen.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL expect >= 0.1.0)
expect_popen — Bourne シェル経由でコマンドを実行し、プロセスへの PTY ストリームをオープンする
command
実行するコマンド。
例1 expect_popen() の例
<?php
// PHP.net の CVS リポジトリにログインします
$stream = expect_popen ("cvs -d :pserver:anonymous@cvs.php.net:/repository login");
sleep (3);
fwrite ($stream, "phpfi\n");
fclose ($stream);
?>