基于php的验证码识别接口调用代码实例

浏览:4782 发布日期:2016/11/11 分类:用法示例 关键字: 验证码识别 API接口
基于php的聚合数据验证码识别接口调用代码实例
在使用验证码识别之前,首先需要申请KEY:https://www.juhe.cn/docs/api/id/60<?php
/**
 * 验证码接口示例
 * 请在本文件所在目录里放置一张图片文件:1.png
 * 可在 http://op.juhe.cn/vercode/demo/assets/images/1.png下载本示例中使用的图片文件 
 */
header("Content-type:text/html;charset=utf-8");
$ch = curl_init('http://op.juhe.cn/vercode/index');
$cfile = curl_file_create('1.png', 'image/png', 'pic.png');
$data = array(
  'key' => '9427ecb33008f9c40857229912345678', //请替换成您自己的key
  'codeType' => '6001', // 验证码类型代码,请在https://www.juhe.cn/docs/api/id/60/aid/352查询
  'image' => $cfile,
);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
评论( 相关
后面还有条评论,点击查看>>