file: test.php
- Code: Select all
#!/usr/local/bin/php
<?
var_dump($argv);
?>
Output:
- Code: Select all
shell> ./test.php -hello -hi
array(3) {
[0]=>
string(10) "./test.php"
[1]=>
string(6) "-hello"
[2]=>
string(3) "-hi"
}
References:
Using PHP from the command line.
