Mysql
 sql >> Datenbank >  >> RDS >> Mysql

UTF-8-Zeichenkodierungskämpfe json_encode()

// Create an empty array for the encoded resultset
$rows = array();

// Loop over the db resultset and put encoded values into $rows
while($row = mysql_fetch_assoc($result)) {
  $rows[] = array_map('utf8_encode', $row);
}

// Output $rows
echo json_encode($rows);