In PHP, all command line arguments, including the script name itself are stored in a special array named $argv. The first element, zero, is the name of the script being run. For example:
echo "This script being executed is named " . $argv . ".\n";
If you run
The output will be
This script being executed is named test.php.
The output will be the same if you begin the file with a shebang like #!/usr/bin/php and run the script by typing
All subsequent arguments will be in the $argv array.