PHP code example of kianhugh / mtphp

1. Go to this page and download the library: Download kianhugh/mtphp 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/ */

    

kianhugh / mtphp example snippets

bash
cd <项目根目录>   # 即本仓库根目录(mtphp/)
composer dump-autoload          # 生成自动加载(未装 composer 也可直接运行演示)

php -S 127.0.0.1:8080 serve.php # 启动内置服务器(开发演示;serve.php 为前端控制器)

# 访问
#   http://127.0.0.1:8080/
#   http://127.0.0.1:8080/hello/世界
#   http://127.0.0.1:8080/api/ping
bash
php bin/server.php              # 默认 0.0.0.0:9501