Home > Backend Development > PHP Tutorial > PHP two multi-dimensional array combination traversal example sharing

PHP two multi-dimensional array combination traversal example sharing

小云云
Release: 2023-03-19 11:04:01
Original
1905 people have browsed it

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'];
  }
 }
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template