PHP code example of gslj / ocr_account_normal

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

    

gslj / ocr_account_normal example snippets



use Ocr\action\Baidu;
use Ocr\lib\Baidu as Lib;

$lib = new Lib([
'client_id'=>'',
'client_secret'=>''
]);
$ocr = new Baidu($lib);
$img_base_64 = '图片base_64编码';
$res = $ocr->accountBook($img_base_64);
var_dump($res);