system()


string system ( string $command [ , string $arg, … ] )

Description

system() executes an external command

※ available F/W version : all

Parameters

Return values

Returns the output string, PHP error on error

Example

<?php
$str = system("uname -svpi");
echo "$str\r\n";
?>

See also

None

Remarks

  1. Refer to the system() function in other manual for detailed information.

  2. This system() function supports another function format.
    The words starting with ‘%’ followed by a number in the string are replaced by parameters.

    For example, the following two functions are exactly the same.

    system("php -d 5 main.php");
    
    $delay = "5";
    $filename = "main.php";
    system("php -d %1 %2", $delay, $filename);
  3. The PHP group's system() function outputs the result to the standard output and returns the last line. But PHPoC's system() returns the result.