1. Go to this page and download the library: Download sonypradana/php-library 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/ */
class GreatConsole extends Console
{
public function main()
{
// getter to get param form cli argument
$name = $this->name ?? 'animus';
style("Great console Aapplication")
->textGreen()
->newLines()
->push("hay my name is ")
->push($name)
->textYellow()
->out()
;
}
}
#!usr/bin/env php
// $argv come with default global php
return (new greatConsole($argv))->main();
Str::chartAt('i love php', 3); // o
Str::concat(['i', 'love', 'php']); // i love php
Str::indexOf('i love php', 'p'); // 8
Str::lastIndexOf('i love php', 'p'); // 10
Str::match('i love php', '/love/'); // love
// ...
// and many more