PHP popen()関数
❮PHPファイルシステムリファレンス例
コマンドパラメータで指定されたプログラムへのパイプを開きます。
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
定義と使用法
popen()関数は、コマンドパラメーターで指定されたプログラムへのパイプを開きます。
構文
popen(command, mode)
パラメータ値
Parameter | Description |
---|---|
command | Required. Specifies the command to execute |
mode | Required. Specifies the connection mode. Can be "r" (Read only) or "w" (Write only - opens and clears existing file or creates a new file) |
技術的な詳細
戻り値: | 失敗するとFALSE |
---|---|
PHPバージョン: | 4.0以降 |
❮PHPファイルシステムリファレンス