The argv parameter's first element will always be the name of the script that has been executed. You can simply ignore that first argument and start from index 1.
Taken from the relevant documentation:
Note: The first argument $argv[0] is always the name that was used to run the script.
As others have mentioned, you can also use the getopt function that is specifically used to extract options, their names, and their valies from a CLI. The argv variable simply holds a list of arguments that were passed. Since the actual program that is being executed is the PHP interpreter, even the script name is an argument.
php my_script.php another_arg more_args
// ^ argv[0].....^ argv[1]...^ argv[2]
As a side note, this behavior of argv including the executing script file is consistent across other platforms/technologies. For example, the same behavior can be seen with python, bash, awk and many many more.
General explanation taken from this page
What is ARGV?
As a concept, ARGV is a convention in programming that goes back (at least) to the C language. It refers to the “argument vector,” which is basically a variable that contains the arguments passed to a program through the command line. It typically manifests as an array and can be manipulated in that way, meaning you can reference specific arguments by index or you can iterate through them in the standard ways.