php函數(shù)array_merge用法一例(合并同類數(shù)組)
更新時(shí)間:2013年02月03日 17:16:30 作者:
合并同類型數(shù)組,array_merge ()函數(shù)的簡(jiǎn)單例子,供大家參考
復(fù)制代碼 代碼如下:
$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數(shù)組類型分析說明
- 類似php的js數(shù)組的in_array函數(shù)自定義方法
- php專用數(shù)組排序類ArraySortUtil用法實(shí)例
- php數(shù)組(array)輸出的三種形式詳解
- php array_filter除去數(shù)組中的空字符元素
- php數(shù)組函數(shù)序列之a(chǎn)rray_keys() - 獲取數(shù)組鍵名
- php array_flip() 刪除數(shù)組重復(fù)元素
- PHP合并數(shù)組+與array_merge的區(qū)別分析
- php數(shù)組函數(shù)序列之a(chǎn)rray_key_exists() - 查找數(shù)組鍵名是否存在
- php數(shù)組查找函數(shù)in_array()、array_search()、array_key_exists()使用實(shí)例
- php in_array() 檢查數(shù)組中是否存在某個(gè)值詳解
- PHP數(shù)組array類常見操作示例
- PHP array_merge() 函數(shù)
相關(guān)文章
php實(shí)現(xiàn)生成PDF文件的方法示例【基于FPDF類庫】
這篇文章主要介紹了php實(shí)現(xiàn)生成PDF文件的方法,結(jié)合實(shí)例形式分析了php基于FPDF類庫實(shí)現(xiàn)生成pdf文件的相關(guān)操作技巧,需要的朋友可以參考下2018-07-07php ignore_user_abort與register_shutdown_function 使用方法
php ignore_user_abort與register_shutdown_function 使用方法小結(jié)。2009-06-06