PHP code example of hahadu / image-to-text

1. Go to this page and download the library: Download hahadu/image-to-text 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/ */

    

hahadu / image-to-text example snippets


use Hahadu\ImageToText\ImageToText;

$file_name = "test.jpg"; //图像路径
$chars = "01"; //设置转换字符
$toText = new ImageToText($chars);
$result = $toText->to_text($file_name);
var_dump($result);