Home  >  Article  >  PHP Framework  >  A brief analysis of how thinkphp5.0 uses the number recognition interface

A brief analysis of how thinkphp5.0 uses the number recognition interface

藏色散人
藏色散人forward
2021-10-25 16:03:342079browse

The following thinkphp framework tutorial column will give you a brief analysis of how thinkphp5.0 uses the digital recognition interface. I hope it will be helpful to friends in need!

A brief analysis of how thinkphp5.0 uses the number recognition interface

tp5.0 Use the digital recognition interface

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);

Recommended: "The latest 10 thinkphp video tutorials"

The above is the detailed content of A brief analysis of how thinkphp5.0 uses the number recognition interface. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete