php函数array_merge用法一例(合并同类数组)

编程学习 2021-07-05 09:49www.dzhlxh.cn编程入门
合并同类型数组,array_merge ()函数的简单例子,供大家参考
代码如下:

$arr1 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=3 or t_pid=6", 0 ); 
$arr2 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=10 or t_pid=12", 0 ); 
$imgInfo = array_merge ( $arr1, $arr2 ); 
if ($imgInfo) { 
   foreach ( $imgInfo as $imgInfo ) { 
       $imgs [] = $imgInfo; 
   } 
}

Copyright © 2016-2025 www.dzhlxh.cn 金源码 版权所有 Power by

网站模板下载|网络推广|微博营销|seo优化|视频营销|网络营销|微信营销|网站建设|织梦模板|小程序模板