PHP code example of limingxinleo / mta

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

    

limingxinleo / mta example snippets




use Xin\Mta\Factory;
use Xin\Mta\H5\Application;
use GuzzleHttp\HandlerStack;

$config = [
    'app_id' => 'xxx',
    'secret_key' => 'xxx',
    'http' => [
        // You can replace it by your own handler. For example SwooleCoroutineHandler.
        'handler' => HandlerStack::create(null),
    ],
];

/** @var Application $app */
$app = Factory::make('h5', $this->getConfig());

$res = $app->page->realtime();

var_dump($res);