Login   Register  
PHP Classes
elePHPant
Icontem

File: PrettyLatin.example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of michał amerek  >  Pretty Latin  >  PrettyLatin.example.php  >  Download  
File: PrettyLatin.example.php
Role: Example script
Content type: text/plain
Description: examples
Class: Pretty Latin
Transliterate text in UTF-8 to Latin characters
Author: By
Last change:
Date: 6 years ago
Size: 764 bytes
 

Contents

Class file image Download
<?php
include("PrettyLatin.class.php");

// simple test example
new PrettyLatin(1);
print
"<br/><br/>";

// same test static call
PrettyLatin::example();
print
"<br/><br/>";


// Polish characters Test
PrettyLatin::example('ąćęłńóśźżĄĆĘŁŃÓŚŹŻ');
print
"<br/><br/>";

?>
<?php 
// post form test
$tst $_POST['tst'];
$char "";
$EC = new PrettyLatin();
?>

<meta http-equiv="Content-type" content="text/html; charset=UTF-8;" />
<form method="post" action="PrettyLatin.example.php">
<label>Put some utf-8 text with national characters</label><br/>
<input name=tst value="<?php echo $_POST['tst'];?>"><br/>
<input type="submit" value="remove diacritic signs">
</form>
<?php
print "to latin=>".$EC->utfToLatin($tst);
?>