i made a json file for my website with MYSQLi entries (the file will be made every time a user searches, or opens the mobile app) i looked into the json file via ftp and it has 5 entries with each 3 elements id, username, email now, when i try to read it in php i get 0 entries
here is the code i use btw, i am learning php since 6 months only (stackoverflow has been the best help ever)
<?php
$string = file_get_contents("empdata.json");
$json_a = json_decode($string, true);
$jsonIterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator(json_decode($json_a, TRUE)),
RecursiveIteratorIterator::SELF_FIRST);
foreach ($jsonIterator as $key => $val) {
if(is_array($val)) {
echo $val;
echo $key;
?><br><br><?php
}
}
?>