There is a problem with the GET method str_replace and imagettftext. When I change the words from the Latin alphabet to the Cyrillic alphabet, it comes out on its own
$cyr = array('а','б','в');
$lat = array( 'a','b','v');
$textlatin = $_GET['textlatin'];
$textrus = str_replace($cyr, $lat, $textlatin);
imagettftext($img, $fontSize, $angle, $x, $y, $fontColor, $fontFile, $textrus);