Created
July 2, 2014 07:17
-
-
Save fasthold/3deb4ac26becb1b2aec6 to your computer and use it in GitHub Desktop.
PHP执行shell捕获输出
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( $res = popen("ls 2>&1","r")){ | |
while ( !feof($res) ) $result .= fgets( $res, 1024 ); | |
pclose($res); | |
echo $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment