Hello, i'm trying to create a simple converter application using php. The main function i use is strtr() that can translate from $string via arrays.
Because the arrays need to add in the file php, so it is difficult to user add their own word in this application. I was create a database that contain 2 fields. The question is how the script to write.
[PHP]
$phonArray=arra y(
'abaian'=>'اباي ن','abbas'=>'عب اس','abd'=>'عبد ','abdal'=>'ابد ال','abdas'=>'ا بدس','abdi'=>'ع بدي',);
$input="Some Texts Here....";//from form
//How to make this $input read from the database first and then proceed to next function strtr() bellow.
$output= strtr($input, $phonArray);
echo"$output";
[/PHP]
Because the arrays need to add in the file php, so it is difficult to user add their own word in this application. I was create a database that contain 2 fields. The question is how the script to write.
[PHP]
$phonArray=arra y(
'abaian'=>'اباي ن','abbas'=>'عب اس','abd'=>'عبد ','abdal'=>'ابد ال','abdas'=>'ا بدس','abdi'=>'ع بدي',);
$input="Some Texts Here....";//from form
//How to make this $input read from the database first and then proceed to next function strtr() bellow.
$output= strtr($input, $phonArray);
echo"$output";
[/PHP]
Comment