Arabic in PHP

Help
Anonymous
2010-10-10
2012-12-12

  • Anonymous
    2010-10-10

    Hello
    I am trying to retrieve data from oracle into PHP and I have successfully accomplished that, but the data appeared in question marks (??????), so I add the AMERICAN_AMERICA.AR8MSWIN1256 to NLS language in the registry for oracle and now the data appears as (ÓÇãÑ ÝíáíÈ ÚíÏ ÇáÚÏíáí). I tried encoding and all suggested character sets from IE and from the PHP code but had no results. I would appreciate some support for this issue
    By the way anything else in the page that is not generated from the database and written in arabic appears arabic so i have no problem with that.
    Thank you

    This is my code

    <META CONTENT="text/html; charset=windows-1256" HTTP-EQUIV="Content-Type">

    اهلاً و سهلان
    <?php

    $conn = oci_connect('MyUser', 'Password', 'Server/DataBase');

    if (!$conn) {
    $m = oci_error();
    echo $m;
    exit;
    }

    $stid = oci_parse($conn, "select Client_name, Client_no, Nationality from CLIENTS
    where Client_No = 8888888888");
    oci_execute($stid);

    // Query the table
    echo "<table border='1'>";
    while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>";
    foreach ($row as $item) {
    echo "<td>".($item!==null?htmlentities($item):"&nbsp;")."</td>";
    }
    echo "</tr>".PHP_EOL;
    }
    echo "</table>";
    oci_free_statement($stid);
    oci_close($conn);

    ?>