I have problem get data from database. Persian words appear as question marks like ???????
. How can I avoid this?
Here is my code:
header('Content-Type: text/html; charset=utf-8');
$conn = mysqli_connect("localhost", "somevalue", "somevalue", "somevalue");
$output = array();
$query = "SELECT * FROM af_home ORDER BY home_id DESC LIMIT 50";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$output[] = $row;
}
echo json_encode($output);
}