I'm trying to build a webpage where two types of users come to my web site. One is the usual English users, and the second one is Persian users ( same text attributes as Arabic, like text direction and text alignment ). So I want to be able to set the text direction of echoed texts depending on users input.
Let me give you an example ;
I have a text input like this :
<form name="myform" action="thispage.php" method="post" target="_self">
<input type="text" id="decsription" name="description" value="" />
<input type="submit" name="submit" value="SUBMIT" >
</form>
<?php
if (isset($_POST['description']))
{
echo '<div align="right" dir="rtl"> Your Chiose is : '.$_POST['description'].'</div>';
}
SO, for example if the text input is typed in english, the echo section would change to something like this :
echo '<div align="left" dir="ltr"> Your Chiose is : '.$_POST['description'].'</div>';
But if the text is non English, then the echo section would be like this :
echo '<div align="right" dir="rtl"> انتخاب شما : '.$_POST['description'].'</div>';
Is this possible to do ?
Thanks for your help.