PHP Classes

File: demo3.php

Recommend this page to a friend!
  Classes of Nemanja Avramovic   Translit-SR   demo3.php   Download  
File: demo3.php
Role: Example script
Content type: text/plain
Description: Example of usage with some russian letters added
Class: Translit-SR
Transliterate Serbian Cyrillic to Latin characters
Author: By
Last change: removed BOM signature because file is utf-8 encoded
Date: 16 years ago
Size: 664 bytes


Class file image Download

include "Translit.class.php";

$translit = new Translit();
$translit->html_aware = false; //when this is true, Translit will skip transliterating cyrilic within html tags
$translit->case_sensitive = false; //this applies only if html_aware is set to true

$translit->cirilica[] = 'Я'; //add russian cyrillic letter "Ya" (uppercase)
$translit->latinica[] = 'Ya'; //transliterate it to latin

$translit->cirilica[] = 'я'; //add russian cyrillic letter "ya" (lowercase)
$translit->latinica[] = 'ya'; //transliterate it to latin

echo $translit->Transliterate('Меня зовут Неманя Аврамовић'); //test in bad russian