How to eliminate\remove last character and space after that and to merge splitted word in php after using OCR for scanning documents
Tried with rtrim, replace etc.. But it also delete - on beginning of text
$delete = array('-');
if(in_array($string[(strlen($string)-1)], $delete))
$string = substr($string, 0, strlen($string)-1);
This is an example of text after ocr scanning
'Th- is is wh- at is looking like after doc- ument is scanned -And it not look- ing good'
You know how it should be
This is what is looking like after document ....
Like I said I tried with replace but "-" sign is also removed from begging of text...
Idea is to remove "- " (dash and space) between splitted word and to marge word again