I have a script, which executes by Example::main("file.csv");
.
I want to run the script from the terminal, but how can I achieve, so I don't define the argument in the script, but in the terminal, like php Example.php file.csv
?
Thanks!
Asked
Active
Viewed 70 times
-1

sklrboy
- 441
- 1
- 6
- 15
-
1Command line arguments are in `$argv` array – u_mulder Dec 10 '16 at 13:18
-
Can you please give me an example for this case? – sklrboy Dec 10 '16 at 13:21
-
Start with `print_r($argv)` – u_mulder Dec 10 '16 at 13:23
-
Resolved with Example::main($argv[1]). – sklrboy Dec 10 '16 at 13:24
-
Answer your question then. – u_mulder Dec 10 '16 at 13:24