PHP code example of littlemo / baidu

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

    

littlemo / baidu example snippets


use littlemo\baidu\Class;

$Class = new Class($apiKey, $secretKey, $planId );


use littlemo\wechat\Class;

$Class = new Class($apiKey, $secretKey);

$result = $Class->access_token();

if ($result) {
    echo '获取Access token成功';
    $token = $Class->getMessage();
} else {
    echo "获取Access token失败";
    $errorMsg = $Class->getErrorMsg();
}

//查询完整的回调消息
$intactMsg = $Class->getIntactMsg();