I have the following array
array(2) {
[0]=>
array(1) {
["data"]=>
string(19) "2015-11-20 00:33:53"
}
[1]=>
array(1) {
["data"]=>
string(19) "2015-11-20 08:24:50"
}
}
How do I access the two ['data']
's?
I have the following array
array(2) {
[0]=>
array(1) {
["data"]=>
string(19) "2015-11-20 00:33:53"
}
[1]=>
array(1) {
["data"]=>
string(19) "2015-11-20 08:24:50"
}
}
How do I access the two ['data']
's?
As follows:
echo $seuArray[0]['data'];
echo $seuArray[1]['data'];
Or by a for loop:
for ($i = 0; $i < count($seuArray); $i++) {
echo $seuArray[$i]['data'];
}
Or with foreach loop:
foreach($seuArray as $item) {
echo $item['data'];
}