I need to get a language file stored in a json file. The problem is that it always returns null, even when the document encoding in the file is UTF-8.
$file = fopen("./language/english/english.json", "r");
while(!feof($file))
{
$lines = fgets($file);
$data = json_decode($lines, true);
var_dump($data);
}
fclose($file);
english.json
{
"english": {
"hello_world": "test"
}
}
returns
NULL NULL NULL NULL NULL