Home >Backend Development >PHP Tutorial >PHP two multi-dimensional array combination traversal example sharing
This article mainly brings you an example of combined traversal of two multi-dimensional arrays in PHP. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
The example is as follows:
$res = $this->LoanRecord->searchloan($conditions,$columns,$page,$this->num,$user_id); foreach ($res[1] as $key => $value) { if(!empty($value['b']['id'])){ $result_day = $this->LoanRecord ->getLastDay($value['b']['id']); $res[1][$key]['m'] = $result_day['m']; } }
Export the table and query separately, and query and traverse separately when writing to excel
Related recommendations:
Detailed explanation of how PHP uses str_replace to replace multi-dimensional arrays
php in multi-dimensional How to find a specified value in an array
Detailed explanation of PHP multi-dimensional array merging and sorting functions
The above is the detailed content of PHP two multi-dimensional array combination traversal example sharing. For more information, please follow other related articles on the PHP Chinese website!