title: PHP Cyrillic transliteration: full html content (without damaging html tags)?
body: <p>How can i easily translite full html content cyrillic  to latency without damaging html tags. eg:</p>
  
  <pre><code>&lt;title&gt;Главная страница&lt;/title&gt;
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>&lt;title&gt;Glavnaja stranica&lt;/title&gt;
  </code></pre>
  
  <p><strong>Example:</strong></p>
  
  <pre><code> $cyr="&lt;p&gt;Кирилица&lt;/p&gt;";
      $lat="&lt;p&gt;Look that p tag replaced with п&lt;/p&gt;";
      $cyrArray = [
          'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п',
          'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',
          'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П',
          'Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я'
      ];
      $latArray = [
          'a','b','v','g','d','e','io','zh','z','i','y','k','l','m','n','o','p',
          'r','s','t','u','f','h','ts','ch','sh','sht','a','i','y','e','yu','ya',
          'A','B','V','G','D','E','Io','Zh','Z','I','Y','K','L','M','N','O','P',
          'R','S','T','U','F','H','Ts','Ch','Sh','Sht','A','I','Y','e','Yu','Ya'
      ];
      $cyr = str_replace($cyrArray, $latArray, $cyr);
      $lat = str_replace($latArray, $cyrArray, $lat);
      echo cyr;// it's ok! no problem.
      echo "&lt;br/&gt;";
      echo  $lat;//but in lat to cryillic we should skip html tags
  </code></pre>
  
  <blockquote>
    <p>Before i asking a question, i was carefully search google and stackoverflow and didn't find capable solution. </p>
  </blockquote>