Thaana conversions class for PHP 5 - v0.4

Here is a major update to the Thaana Conversions class for PHP 5 that I have been maintaining. This new version adds two new functions convertLatinToAscii() and its counterpart convertAsciiToLatin(), which transliterates text to and from the latinized/romanized Thaana form. That means you can pass on text bits like "miadhakee reethi dhuvahekeve" and have it converted to "މިއަދަކީ ރީތި ދުވަހެކެވެ".

This feature would facilitate Thaana websites to add cool and interesting new features like, say, offering to display a news article in latinized Thaana if the user does not have the required fonts installed and/or cannot install the Thaana fonts!


The Thaana Conversions class for PHP provides a number of useful functions for the conversion and transliteration of text between various Thaana representation formats.

Functions exposed

- convertUtf8ToUnicodeIntegers()
- convertUtf8ToAscii()
- convertUtf8ToEntities()
- convertEntitiesToUnicodeIntegers()
- convertEntitiesToUtf8
- convertEntitiesToAscii()
- convertUnicodeIntegersToUtf8()
- convertUnicodeIntegersToEntities()
- convertUnicodeIntegersToAscii()
- convertAsciiToUtf8()
- convertAsciiToEntities()
- convertAsciiToUnicodeIntegers()
- convertLatinToAscii()
- convertAsciiToLatin()




This script is released under the Open Source MIT License, allowing its use in both personal and commercial applications as long as the copyright and license permission notice remains intact.


// Load the class
require 'thaana_conversions.obj.php';

// Initialize the Thaana object
$thaana = new Thaana_Conversions();

// Example: Converting latin to ascii
echo $thaana->convertLatinToAscii('miadhakee haadha reethi dhuvahekeve.');

// Example: Converting ascii to latin
echo $thaana->convertAsciiToLatin('miawdwkI hWdw rIti duvwhekeve.');


- (v0.4, 4.8KB)

Enjoy :-)


  1. No Trackbacks


Display comments as (Linear | Threaded)

  1. No comments

Add Comment

HTML-Tags will be converted to Entities.
Standard emoticons like :-) and ;-) are converted to images.
To leave a comment you must approve it via e-mail, which will be sent to your address after submission.