Step one:
Go to Baidu Smart To download the digital recognition SDK from the cloud, you only need to keep AipOcr.php and the lib folder
Step 2:
Put the above two files into a folder and upload it to tp project/extend Next
The third step:
Introduce this class
\think\Loader::import('OCR/AipOcr',EXTEND_PATH); $client = new \AipOcr('AppID', 'API Key', 'Secret Key'); $image = file_get_contents('图片路径'); // 调用数字识别 $result = $client->numbers($image); halt($result);