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 파일 시스템 참조