PHP code example of cccdl / agora_sdk

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

    

cccdl / agora_sdk example snippets




use cccdl\agora_sdk\Token;

$config =  [
    'appid' => '请填写您的AppId',
    'appCertificate' => '请填写您的声网证书',
]

$RtcTokenBuilder = new RtcTokenBuilder($config);
$token = $RtcTokenBuilder->buildTokenWithUid('test', {此处填写整形uid},  {过期时间秒数});