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

前端之家收集整理的这篇文章主要介绍了php函数array_merge用法一例(合并同类数组)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<div class="codetitle"><a style="CURSOR: pointer" data="50579" class="copybut" id="copybut50579" onclick="doCopy('code50579')"> 代码如下:

<div class="codebody" id="code50579">
$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,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;
}
}

原文链接:https://www.f2er.com/php/26782.html

猜你在找的PHP相关文章