首页 营业执照识别 营业执照识别示例代码 营业执照识别[PHP]

营业执照识别示例代码[PHP]

作者: 阅读数:1504 上传时间:2017-07-27

营业执照识别

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/businesslicenserecognition/recognize?appkey=$appkey";

$post = array(
    'pic'=>base64_encode(file_get_contents('sfz1.jpg')), //'@'.realpath('11.jpg')    
);
$result = curlOpen($url, array('post'=>$post, 'isupfile'=>true));
$jsonarr = json_decode($result, true);

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}
$result = $jsonarr['result'];
echo $result['name'].' '.$result['creditno'].' '.$result['legalperson'].' '.$result['regcapital'].'
'; echo $result['regdate'].' '.$result['enddate'].' '.$result['regaddress'].' '.$result['scope'].'
'; echo $result['regorgan'];