PHP code example of webguosai / searchkey-baidu

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

    

webguosai / searchkey-baidu example snippets


$baidu = new \Webguosai\SearchKeyBaidu();

$baidu->getScript($id);

try {
    $baidu->query($pathId, $siteId, $cookie, $limit);
} catch (Exception $e) {
    echo $e->getMessage();
}