1. Go to this page and download the library: Download xianglin/first-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/ */
xianglin / first-composer example snippets
/**
* Created by xianglinl
* User:liubo
* Date:2020/5/26
* Time:20:14
*/
namespace firstComposer;
class TestComposer
{
public function showTime()
{
echo '当时北京时间: ' . date('Y-m-d H:i:s');
}
}
irstComposer\TestComposer;
(new TestComposer())->showTime();
firstComposer\TestComposer;
(new TestComposer())->showTime();