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

PHP two multi-dimensional array combination traversal example sharing

小云云
小云云Original
2018-01-06 16:25:401850browse

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!

Statement:
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