Hello everyone, i wanted to get the value of this array using foreach and wanted to echo it outside foreach but i get 1 echo data only
Array
(
[status] => 1
[msg] => Array
(
[total_records] => 5
[total_pages] => 1
[page_number] => 1
[per_page] => 100
[return_count] => 5
[page_result] => Array
(
[0] => Array
(
[items] => 223687201
[is_tort] => 0
)
[1] => Array
(
[items] => 218508001
[stock] => 3
)
[2] => Array
(
[items] => 180097801
[stock] => 5
)
[3] => Array
(
[items] => 178000403
[stock] => 2
)
[4] => Array
(
[items] => 200052001
[stock] => 1
)
)
)
[errcode] => 0
)
$gplus = $decodedInventoryArray['msg']['page_result'];
foreach($gplus as $kuda){
echo $kuda['items']."<br />";
}
echo $kuda['items']."<br />";
output :
223687201
218508001
180097801
178000403
178000403
Its only echo the last item, can you guys show me how to echo the item same like it echo when inside foreach loop?