Displaying characters on the Web
AmineDzJul 11 2011 — edited Jul 11 2011Hi All,
I have this script that brings data from a DB.
<?php
$conn = oci_connect('my_user', 'my_pwd', 'my_db');
$stid = oci_parse($conn, 'select arabic_name from emp where id = 1');
oci_execute($stid);
echo "<table>\n";
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : " ")."</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
echo "ãÍãÏ Ããíä";
?>
The output is :
<table>
<tr>
<td>ãÍãÏ Ããíä</td>
</tr>
</table>
ãÍãÏ Ããíä
The problem is that "ãÍãÏ Ããíä" is completly equivalent to "ãÍãÏ Ããíä".
It seems like PHP is interpreting the data from my_db.
How can I redirect PHP behavior so it brings "ã" rather then "ã" and "Í" rather then "Í", ...
So my desired out put is :
<table>
<tr>
<td>ãÍãÏ Ããíä</td>
</tr>
</table>
ãÍãÏ Ããíä
Thank you in advance