2
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 both ['data']
's ?
2
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 both ['data']
's ?
3
As follows:
echo $seuArray[0]['data'];
echo $seuArray[1]['data'];
Or for a tie for:
for ($i = 0; $i < count($seuArray); $i++) {
echo $seuArray[$i]['data'];
}
Or with foreach loop:
foreach($seuArray as $item) {
echo $item['data'];
}
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.