Код: Выделить всё
BLAPFEN L√
Вот что я пытаюсь:< /p>
Код: Выделить всё
$txt = trim(preg_replace('/[^A-Za-z0-9öÖäÄüÜß\- ]/', ' ', $txt));
Это работает, когда я помещаю строку непосредственно в файл PHP и пытаюсь чтобы удалить его:
Код: Выделить всё
$txt = 'BLAPFEN L√';
$txt = trim(preg_replace('/[^A-Za-z0-9öÖäÄüÜß\- ]/', ' ', $txt));
echo $txt;
API — это Google Cloud OCR, если это имеет значение, и это код как я это понимаю:
Код: Выделить всё
$txt = '';
$tadaa = $vision->annotate($img);
$obj = $tadaa->text();
if(isset($obj) && $obj[0] != null){
$arr = $obj[0]->info();
$txt = $arr['description'];
$txt = str_replace(["\n\r", "\n", "\r"], ' ', $txt);
$txt = str_replace(' ', ' ', $txt);
$txt = trim(preg_replace('/[^A-Za-z0-9öÖäÄüÜß\- ]/', ' ', $txt));
}
[img]https:// i.sstatic.net/TpW59v3J.jpg[/img]
Подробнее здесь: https://stackoverflow.com/questions/790 ... f-google-c