I have an array like this:
array(4) {
[0]=>
array(1) {
["id"]=>
string(3) "207"
}
[1]=>
array(1) {
["id"]=>
string(4) "1474"
}
["date"]=>
string(39) "Fri Dec 08 2017 00:00:00 GMT+0700 (WIB)"
["content"]=>
string(4) "test"
}
I know how to access date
and content
but I don't know how to access id
. I tried using this loop:
for ($i=0; $i < count($data); $i++){
var_dump($data[$i]['id']);
}
But I got error
Undefined offset: 2 for content and date.
How can I access those ids?