1. Go to this page and download the library: Download isaeken/strargs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
isaeken / strargs example snippets
$strargs = new \IsaEken\Strargs\Strargs('command "my name is" "isa eken" --details="{\"age\": 19, \"gender\": \"Male\"}" --friends[]=\"Nur\" -vvv');
$strargs->getArgument(0); // "my name is"
$strargs->getArgument(1); // "isa eken"
$strargs->getOption('details'); // (object) ["age" => 19, "gender" => "Male"]
$strargs->getOption('friends'); // ['Nur']
$strargs->getVerbose(); // "debug"