PHP two multidimensional array combination case

墨辰丷
Release: 2023-03-26 11:32:01
Original
1707 people have browsed it

The following editor will bring you an example of combined traversal of two multi-dimensional arrays in PHP. Let me share it with you now and give it as a reference for 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 table separate query , separate query traversal when writing to excel


Related recommendations:

Detailed explanation of PHP multi-dimensional array sorting

Summary of JS methods for traversing irregular multi-dimensional arrays

How to write JS when you need to traverse irregular multi-dimensional arrays

The above is the detailed content of PHP two multidimensional array combination case. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!