首页 > 开发 > PHP > 正文

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

2024-05-04 23:08:46
字体:
来源:转载
供稿:网友

复制代码 代码如下:


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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表