首頁 >後端開發 >php教程 >php函数array_merge用法一例(合并同类数组)_PHP教程

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

WBOY
WBOY原創
2016-07-21 15:13:28755瀏覽

复制代码 代码如下:

$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; 
   } 
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/326475.htmlTechArticle复制代码 代码如下: $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_arr...
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn