下面thinkphp框架教程欄目將給大家簡(jiǎn)析thinkphp5.0如何使用數(shù)字識(shí)別接口,希望對(duì)需要的朋友有所幫助!
tp5.0 使用數(shù)字識(shí)別接口
第一步:
去百度智能云下載數(shù)字識(shí)別的SDK, 只需要保留 AipOcr.php 以及l(fā)ib文件夾
第二步:
將上述兩個(gè)文件放到一個(gè)文件夾中 上傳至tp項(xiàng)目/extend下
第三步:
引入該類(lèi)
thinkLoader::import('OCR/AipOcr',EXTEND_PATH); $client = new AipOcr('AppID', 'API Key', 'Secret Key'); $image = file_get_contents('圖片路徑'); // 調(diào)用數(shù)字識(shí)別 $result = $client->numbers($image); halt($result);
推薦:《最新的10個(gè)thinkphp視頻教程》