PHP code example of marshung / my-composer
1. Go to this page and download the library: Download marshung/my-composer 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/ */
marshung / my-composer example snippets
=
namespace marshung\hello;
class HelloWorld
{
private $name;
public function __construct($name = 'World') {
$this->name = $name;
}
public function getName() {
return $this->name;
}
public function hello() {
return 'Hello ' . $this->name . '!';
}
}
=
= new \marshung\hello\HelloWorld();
echo $obj->hello();
echo "\n";
$obj = new \marshung\hello\HelloWorld('My Goddess');
echo $obj->hello();