1. Go to this page and download the library: Download lea-reift/ocr-space library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lea-reift / ocr-space example snippets
use LeaReift\OcrSpace\Client;
$response = (new Client('your-apikey'))
->fromUrl('https://dl.a9t9.com/ocr/solarcell.jpg')
->get();
public function __construct(string $apiKey, string $baseUrl = "https://api.ocr.space", string $endpoint = "/parse/image")
use LeaReift\OcrSpace\Client;
$client = new Client('your-api-key-here');
public function fromFile(string|CURLFile $file): self
// Using string
$client->fromFile('/path/to/image.png');
// Using CURLFile
$curlFile = new CURLFile('/path/to/image.png');
$client->fromFile($curlFile);
public function fromBase64String(string $base64String): self