I'm trying to print data from an array:
$card_list = Array(Array("Red", "あかい"), Array("Blue", "あおい"), Array("Green", "みどり"));
foreach ($card_list as $card_row)
{
print $card_row[0] . " | " . $card_row[1] . "<br />";
}
However, chrome and IE. both output:
Red | ???
Blue | ??
Green | ???
Expected output is:
Red | あかい
Blue | あおい
Green | みどり
I've tried adding the following things to make it work (from past answers to similar questions) to no avail.
header('Content-Type: text/html; charset=utf-8');
mb_internal_encoding('UTF-8');
<meta charset="utf-8" />
Is it possible to get this to print without escaping the input? I'd really rather not having to do that.
As requested, here's all related code that I'm running with at the moment
<?php
header('Content-Type: text/html; charset=UTF-8');
mb_internal_encoding('UTF-8');
$card_list = Array(Array("Red", "あかい"), Array("Blue", "青い"), Array("Green", "みどり"));
?>
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="flashcard_block">
<?php
foreach ($card_list as $card_row)
{
print $card_row[0] . " | " . $card_row[1] . "<br />";
}
?>
</div>
</body>
</html>