php函数array_merge用法一例(合并同类数组)_PHP
程序员文章站
2024-01-08 10:02:04
...
复制代码 代码如下:
$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;
}
}
$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;
}
}
推荐阅读
-
php函数array_merge用法一例(合并同类数组)_PHP
-
PHP将两个关联数组合并函数提高函数效率_PHP教程
-
php通过array_merge()函数合并关联和非关联数组的方法,array_merge数组
-
php通过array_merge()函数合并关联和非关联数组的方法_PHP教程
-
PHP将两个关联数组合并函数提高函数效率
-
PHP 将数组打乱 shuffle函数的用法及简单实例,打乱shuffle
-
php基础之数组的合并、拆分、区别取值函数集
-
PHP合并数组+与array_merge的区别分析_PHP教程
-
php数组操作函数之array_push()函数用法与定义
-
PHP 将数组打乱 shuffle函数的用法及简单实例