Arapça Türkçe Harflerin ve Kelimelerin Okunuşu

Not: Okunuş tüm sesli harfleri içermez. Bu yüzden gerçek değil, programsal okunuşu oluşturur.

<?php
header('Content-Type: text/html; charset=utf-8');
class Oku{
	var $turkce=['b','z','t','m','t','r','z','n','s','z','a','h','c','s','ğ','h','g','f','h','s','ş',
		'd','d','k','e','e','i','ü','i','e','e','y','t','y','l','v','en','ün','in','e','ü','i','~','o'];
	var $arapca=['\u0628','\u0630','\u0637','\u0645','\u062a','\u0631','\u0638','\u0646',
		'\u062b','\u0632','\u0639','\u0647','\u062c','\u0633','\u063a','\u062d','\u0642','\u0641','\u062e','\u0635',
		'\u0634','\u062f','\u0636','\u0643','\u0623','\u0621','\u0626','\u0624','\u0625','\u0622','\u0627','\u0649',
		'\u0629','\u064a','\u0644','\u0648','\u064b','\u064c','\u064d','\u064e','\u064f','\u0650','\u0651','\u0652'];
	var $onceki=["lr","nb","nl","nr","nm","ny","ns","nt","nd","nc","nz","nş","nk","ng","nf","bm","gk"];
	var $sonraki=["rr","mb","ll","rr","mm","yy","s","t","d","c","z","ş","k","g","f","mm","kk"];
	function arapcaTurkce($metin){
		$unicode=str_replace('"',"",json_encode($metin));
		$turkce=str_replace($this->arapca,$this->turkce,$unicode);
		return str_replace($this->onceki,$this->sonraki,$turkce);
	}
	function turkceArapca($metin){
		mb_internal_encoding('UTF-8');
		$metin=mb_strtolower($metin);
		$metin=str_replace(["u","o","ö","ı",],["ü","ü","ü","i"],$metin);
		$metin=str_replace($this->sonraki,$this->onceki,$metin);
		$metin=str_replace($this->turkce,$this->arapca,$metin);
		return json_decode('"'.$metin.'"');
	}
}
$cevir=new Oku;
echo $cevir->arapcaTurkce("ؤلؤنثعن ىعنذئلئم");
echo "<br>";
echo $cevir->turkceArapca("Ulusan Yazılım");
echo "<br>";

Çıktısı

ؤلؤنثعن ىعنذئلئم
ülüsan yazilim