update : 2015.11.03
php.shukuma.com검색:
|
popen(PHP 4, PHP 5, PHP 7) popen — Opens process file pointer 설명
resource popen
( string
$command
, string $mode
)
Opens a pipe to a process executed by forking the command given
by 인수
반환값Returns a file pointer identical to that returned by fopen(), except that it is unidirectional (may only be used for reading or writing) and must be closed with pclose(). This pointer may be used with fgets(), fgetss(), and fwrite(). When the mode is 'r', the returned file pointer equals to the STDOUT of the command, when the mode is 'w', the returned file pointer equals to the STDIN of the command.
If an error occurs, returns 예제
Example #1 popen() example
<?php If the command to be executed could not be found, a valid resource is returned. This may seem odd, but makes sense; it allows you to access any error message returned by the shell: Example #2 popen() example
<?php 주의
Warning
안전 모드에서 명령어는 escapeshellcmd()로 회피처리됩니다. 그러므로, echo y | echo x는 echo y \| echo x가 됩니다. 참고
|