Home >Backend Development >PHP Tutorial >An example of usage of php function array_merge (merging similar arrays)_PHP tutorial

An example of usage of php function array_merge (merging similar arrays)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:13:28754browse

复制代码 代码如下:

$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...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn