-1

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!

5
  • 1
    Command line arguments are in $argv array Commented Dec 10, 2016 at 13:18
  • Can you please give me an example for this case? Commented Dec 10, 2016 at 13:21
  • Start with print_r($argv) Commented Dec 10, 2016 at 13:23
  • Resolved with Example::main($argv[1]). Commented Dec 10, 2016 at 13:24
  • Answer your question then. Commented Dec 10, 2016 at 13:24

1 Answer 1

-1

Example::main($argv[1]); is the solution.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.