Use $argc and $argv[], just like in C, like so, if your script looked like this:
<?php
foreach ($argv as $key=>$value){
print $key.":".$value."\n";
}
?>
then calling it like this:
php -q testbed this is a test
will give you this:
0:testbed
1:this
2:is
3:a
4:test
as output. Note that the zeroth arg is the name of the script.