I'm familiar with the basic of CLI and $argv array with php. Example:
<?php // test.php
var_dump($argv);
?>
$php test.php datafile.txt 10 100
will produce:
array(4) {
[0]=>
string(8) "test.php"
[1]=>
string(12) "datafile.txt"
[2]=>
string(2) "10"
[3]=>
string(3) "100"
}
What I'm trying to do is pass all files in a directory *.txt to php. Is there way I can do $php test.php *.txt
and have all the filenames stored in an array?
Edit: for the solution I just use the glob function
<?php
$files = glob($argv[1]);
?>