欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

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

程序员文章站 2022-05-17 08:26:26
...
复制代码 代码如下:

$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...