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

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

藏色散人
Release: 2021-10-25 16:03:34
forward
2123 people have browsed it

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);
Copy after login

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!

Related labels:
php
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template