PHP code example of davidyou / hello-douyin

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

    

davidyou / hello-douyin example snippets




use HelloDouYin\MiniProgram\Application;

$config = [
    'app_id' => '5660f39249esdfxd',
    'secret' => '42f4f28f73423dfdsd072xxx',
    'aes_key' => 'opqrstuvwxyz01267EdSBCDEFG',
    'token' => 'HelloDouYin',
];

$app = new Application($config);

$server = $app->getServer();

$server->with(fn() => "您好!HelloDouYin!");

$response = $server->serve();