database issue with arabic encoding
<p>I have a wordpress website and for some reason all records values that are in Arabic language change to be like this <code>Ù…ÙˆÙ‚Ø¹ Ø§Ù„Ø·Ø¨ Ø§Ù„Ù†ÙØ³ÙŠ</code> although the database and it's tables collation <code>utf8mb4_unicode_ci</code>.To fix this issue i have decided to make script to select all records from each table and then <code>iconv</code> each value to be for example something like this <code>عنوان باللغة العربية</code>.</p>

<p>Now the problem i have tried everything and it's not working for me</p>

<pre><code>    header('Content-Type: text/html; charset=utf-8');

$sql['host']        = "localhost";
$sql['username']    = "root";
$sql['password']    = "";
$sql['database']    = "nafsynet_database";

$connection = mysqli_connect($sql['host'], $sql['username'], $sql['password'], $sql['database']);

if (!$connection) {
    $out .= "Error: Unable to connect to MySQL." . PHP_EOL;
    $out .= "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
    $out .= "Debugging error: " . mysqli_connect_error() . PHP_EOL;

    echo $out;

    die();
}

$sql    = "SELECT * FROM `nfsy_options` WHERE 1 LIMIT 10";
$result = mysqli_query($connection, $sql);
$rows   = mysqli_fetch_all($result,MYSQLI_ASSOC);

foreach($rows as $row) {
    $text =  $row['option_value'];

    echo iconv('windows-1256', 'utf-8',$text);echo'&lt;br&gt;';
}

mysqli_close($connection);
</code></pre>