0

I am using getopt() to get php command line arguments. I want to collect a list of files or directories using the *.

Example

in

/my/dir/file1.jpg
/my/dir/file2.jpg
/my/dir/file3.jpg

I would like:

$ ./myscript.php -s *.jpg

for optarg[s], I would like to get an return an array containing:

array(file1.jpg, file2.jpg, file3.jpg)

I've searched for a solution but all I can manage to get back is the first match.

4

0 回答 0