I need to display some RTL text inline on a LTR page.
I'm storing country names in a single field in a MySQL database in the format EnglishName (LocalLanguageName). When the local language is RTL text the output created by my PHP is broken.
For example Israel is stored in the database as:
Israel (ישר×ל)
My PHP code is:
print "<li>$row[Country], ";
print date('jS M Y',strtotime($row[StartDate]));
print "</li>\n";
Which outputs:
<li>Israel (ישראל), 1st Jan 2013</li>
If I remove the date line the closing parenthesis and the comma are in the correct position.
If I put "x".
in front of the date I get the expected:
<li>Israel (ישראל), x1st Jan 2013</li>
Adding dir="LTR"
to the <li>
element doesn't work because the output html is incorrect.
How do I get an output of <li>LTR name (RTL name), date</li>
?
Thanks