I have a database and it stores discord guilds in it and the discord guilds can have emojis like and • . I am having an issue though when I am trying to do a foreach on the data it just says
PHP Warning: Invalid argument supplied for foreach() in /path/to/my/php/file
I just want to either entirely remove all emojis/unicodes or just be able to show them normally within the foreach statement without a ton of work.
Foreach im using
$stmt = $conn->prepare("SELECT guilds FROM users WHERE discord_id = :discord_id");
$stmt->bindParam(':discord_id', $userdata['discord_id']);
$guildData = $stmt->fecth(PDO::FETCH_ASSOC);
$guildData = json_decode($guildData, true);
var_dump($guildData);
foreach($guildData as $g) {
echo $g;
}
Sample of the data that is in the column guilds:
[{"id": 1, "guildname": "Server Name "}, {"id": 2, "guildname": "Server Name"}]
I want to either keep them and show all the emojis or just entirely remove all unicode emojis and symbols.