We can access parameters passed via the command line in our PHP shell scripts. Those are stored as an array in the variable $argv. Consider this:
The first part of the script prints out all parameters that have been given, while the second part checks if the parameter was "x" or not. Note that the first item in the array ($argv) will be the the first item on the command line, i.e. the file name and path to this very script. $argv is the first parameter, $argv the second, and so forth.
We can call the script withscript.php x
to give it one parameter, or withscript.php x y z
to give it three parameters.