forked from A9T9/OCR.Space-OCR-API-Code-Snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathocrapi.php
More file actions
23 lines (15 loc) · 673 Bytes
/
ocrapi.php
File metadata and controls
23 lines (15 loc) · 673 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//**********************************************
// This code snippet is outdated.
// Please see the "PHP Demo Web App" instead.
//**********************************************
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
//Original curl line was
//curl --form "file=@ingredients.jpg" --form "apikey=helloworld" --form "language=eng" --form "isOverlayRequired=true" https://api.ocr.space/parse/image
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.ocr.space/parse/image");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close ($ch);