Last Updated: February 25, 2016
· frank-dspeed

Creating CLI & WEB PHP Applications in a Easy Way

PHP Convert $ARGV to $_GET Array for CLI & WEB
Hello Today i whant to Publish a Little bit of Code to Make a PHP Application Respond to Args Parms as also Get Parms so the Script can be executed via CLI and WEB

I think this Method will save a lot of headache Hope it Helps you in Your Projects

It Simply Checks if argv is existing and then converts it to the GET array that you can use in your scripts then for cli and web without much round trip

// ADD If isset argv first and then simply use only the $GET array in your scripts!
foreach ($argv as $arg) {