<?php

$regexp = '/(\\b([a-zA-Z]+)([а-яёА-ЯЁ]+)\\b)|(\\b([а-яёА-ЯЁ]+)([a-zA-Z]+)([а-яёА-ЯЁ]+)\\b)|(\\b([а-яёА-ЯЁ]+)([a-zA-Z]+)\\b)|(\\b([a-zA-Z]+)([а-яёА-ЯЁ]+)([a-zA-Z]+)\\b)/u';
$regexpLetter = ['/a/', '/A/', '/c/', '/C/', '/e/', '/E/', '/K/', '/O/', '/o/', '/y/'];
$replaceLetter = ['а', 'А', 'с', 'С', 'е', 'Е', 'К', 'О', 'о', 'у'];

$text = 'Kartоn это картoнка';
$words = explode(" ", $text);

$matches = array();
preg_match_all($regexp, $text, $matches);

$correctWOrds = array();

for($i = 0; $i < count($matches[0]); $i++) {
  $correctWOrds[$i] = preg_replace($regexpLetter, $replaceLetter, $matches[0][$i]);
}

for($i = 0; $i < count($words); $i++) {
  for($b = 0; $b < count($correctWOrds); $b++) {
    if ($words[$i] == $matches[0][$b]) $words[$i] = $correctWOrds[$b];
  }
}

$correctText = implode(' ', $words);

echo $correctText;