PHP code example of khsing / wechat-agent

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

    

khsing / wechat-agent example snippets


use Khsing\WechatAgent\WechatAgent;
$agent = new WechatAgent;

$agent->is("Wechat"); // return true or false 


$agent->version_compare("Wechat", "6.6.3"); // return -1 if lower than 6.6.3, return 0 if equal, return 1 if greater than 6.6.3
$agent->version_compare("Wechat", "6.6.1", ">="); // return true if greater than 6.6.1

$agent->nettype() // return 4G/WIFI etc.