Last active
October 29, 2021 02:50
-
-
Save denihida1216/a884877e4169d493b52030ceca78cab2 to your computer and use it in GitHub Desktop.
PHP json encode - Malformed UTF-8 characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$song = 'Can't Get Enough'; | |
#solved1 | |
var_dump(mb_convert_encoding($song, 'UTF-8', 'HTML-ENTITIES')); | |
#solved2 | |
var_dump(json_encode($song, JSON_INVALID_UTF8_IGNORE)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment