2013-07-05

PHP - UTF-8 fields into arrays


After this, you can use the array properly as it will store the UTF-8 characters appropriately (won't display nulls as it would otherwise). Json_encode will work just fine after this.

while( $row = mysql_fetch_assoc($result,MYSQL_ASSOC) ) {
  $rows[] = array_map( 'utf8_encode', $row );
}

No comments:

Post a Comment