#!/usr/bin/php -q
<?php
echo "Test Read Arguements:\n\n";
echo $_SERVER["argc"] . "\n";
echo $_SERVER["argv"][0] . "\n";
echo $_SERVER["argv"][1] . "\n";
?>
$_SERVER["argc"] will give the number arguments enter including. Note the script itself is an argument.
$SERVER["argv"] is an array of arguments. To access the first argument it will be at index 1, $SERVER["argv"][1]. Remember the file name itself is at index 0, $_SERVER[argv"[0].
-from PHP CLI and CRON