In json.php:
$data = array ( "filename" => array (), "datetime" => array () );
The $data array is filled with some data from a loop.
In index.php:
$.ajax({
url: "json.php",
success: function(data){
$.each(data, function(i, item) {
console.log(data[i].filename);
});
}
});
I'm trying to print all the filenames from my data object, but they're undefined according to the console. What did I miss?