我正在尝试使用 ABBYY.com 的 PHP 中的 OCR SDK 来识别名片。我有以下代码只是为了检查它是如何工作的。当我执行代码时,我得到一个空白输出。我在哪里可能在代码上出错?
$applicationId = "MyBusinessCardReader"; $password = "密码"; $filename = "businesscard.jpg"; $localDir = 目录名(__FILE__); $url = "http://cloud.ocrsdk.com/processBusinessCard"; $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_USERPWD, "$applicationId:$password"); curl_setopt($c, CURLOPT_POST, 1); $post_array = 数组( "my_file" => "@$localDir$filename" ); curl_setopt($c, CURLOPT_POSTFIELDS, $post_array); $response = curl_exec($c); curl_close($c); 回声“<pre>”; 回声$响应; 回声“</pre>”;