i'm using this function http://php.net/manual/en/function.getopt.php to do this
$options = getopt(array('c::'), array('chunk::'));
var_dump($options);
this code located in a file called do.php and i using this shell command to print the result
for i in `seq 2`;do php /home/user/public_html/do.php --chunk=$i ;done
the result is
array(2) {
["chunk"]=>
string(1) "1"
}
array(2) {
["chunk"]=>
string(1) "1"
}
how that happend? it should
array(2) {
["chunk"]=>
string(1) "1"
}
array(2) {
["chunk"]=>
string(1) "2"
}
(PHP VERSION 5.4.45)