I am passing some arguments to a PHP file from bash. Current code is working fine:
foreach($argv as $value)
{
$a= $a . "\n" . $value;
}
However I am looking for a way to start the foreach from the 3rd item of the array (which is variable so I don't know how many arguments the script will receive). Any ideas on how I can skip the first 3 elements?
Thanks!
foreach(array_slice($argv,3) as $value){ $a= $a . "\n" . $value; }