If I've got a CLI script foo written in PHP that requires various command line options, can I invoke foo from another PHP script by first writing to $argv and $argc and then doing include('foo')? (Assume foo starts with <?php, not a hash-bang directive.)
Even if this would "work", why is it a bad idea? (apart from namespace collision).
It is not necessary to write anything into $argv /$argc - the variables will be available to the include like they are to the main script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With