string exec ( string $command [, array &$output [, int &$return_var ]] )
exec() executes the given command .

command – The command that will be executed.

output – If the output argument is present, then the specified array will be filled with every line of output from the command.

return_var – If the return_var argument is present along with the output argument, then the return status of the executed command will be written to this variable.

contoh script ping ;

$command = “ping -n 1 www.google.com”;

$a = exec($command, $returnValue);

foreach($returnValue as $value )
echo $value.”<br>”;

This entry was posted in PHP and tagged , .

Leave a Reply


3 + = eight