shell_exec() - execute shell command using php file - PHP Views : 276
Tagged in : PHP
Send mail vote down 0 vote down 0
shell_exec()
This function is used to execute a shell command via PHP file. It returns complete output as a string.
Example:
<?php
$output = shell_exec('ls -lart');
echo "
$output
";
?>

The above code will list the permissions of the file, user of the file, owner of the file, size of the file, date of creation and filename.
By - Nirmala, On - 2010-04-07




    Login to add Comments .