Now, you can use iApp AI API service with PHP Composer package. It is the api client library for iApp AI API service for PHP.
$ composer require iapp-ai/iapp-php-composer
Note: This environment is using composer.
<?php
ini_set("include_path", "iapp-php-composer");
require_once 'iapp-php-composer/module_api.php';
################### API KEY ####################
$object = new api;
$object->apikey("XXX Your API Key XXX");
################### ID CARD OCR API ####################
// OCR on Photocopied of ID Card
$res = $object->idcard_front_photocopied("media/copy_of_thai_idcard_trial.png");
print_r($res);
// result:
// {'address_alley': '', 'address_district': 'บางละมุง', 'address_full': '33/349 หมู่ที่ 7 ต.หนองปรือ อ.บางละมุง จ.ชลบุรี', 'address_house_no': '33/349', 'address_lane': '', 'address_number': '33/349 หมู่ที่ 7', 'address_postal_code': '20150', 'address_province': 'ชลบุรี', 'address_road': '', 'address_subdistrict': 'หนองปรือ', 'address_village': '', 'address_village_no': '7', 'date_of_birth': '1957/03/22', 'date_of_expire': '2025/03/21', 'date_of_issue': '2016/07/26', 'error_detail': 'successfully performed ocr', 'file_name_id_card': 'copy_of_thai_idcard_trial.png', 'fullname_en': 'Mrs. Bunyang Lopez', 'fullname_th': 'นาง บุญยัง โลเปช', 'init_en': 'Mrs.', 'init_th': 'นาง', 'name_en': 'Bunyang', 'name_th': 'บุญยัง', 'national_id': '3411700830334', 'process_time': 0.71, 'reason_code_api': 200, 'reason_code_id_card': 1, 'reason_code_id_card_national_id': 1, 'reason_code_id_card_signature': 1, 'request_id': '1dcc2bdb-bcba-43e4-810e-5ca183b44566#112798', 'surname_en': 'Lopez', 'surname_th': 'โลเปช'}
?>