php函數(shù)array_merge用法一例(合并同類數(shù)組)
更新時間:2013年02月03日 17:16:30 作者:
合并同類型數(shù)組,array_merge ()函數(shù)的簡單例子,供大家參考
復制代碼 代碼如下:
$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用法實例
- php數(shù)組(array)輸出的三種形式詳解
- php array_filter除去數(shù)組中的空字符元素
- php數(shù)組函數(shù)序列之a(chǎn)rray_keys() - 獲取數(shù)組鍵名
- php array_flip() 刪除數(shù)組重復元素
- 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()使用實例
- php in_array() 檢查數(shù)組中是否存在某個值詳解
- PHP數(shù)組array類常見操作示例
- PHP array_merge() 函數(shù)
相關(guān)文章
PHP連接MSSQL2008/2005數(shù)據(jù)庫(SQLSRV)配置實例
這篇文章主要介紹了PHP連接MSSQL2008/2005數(shù)據(jù)庫(SQLSRV)配置方法,實例講述了完整的連接與配置過程,并提供了具體的擴展文件下載與測試代碼,需要的朋友可以參考下2014-10-10
PHP中auto_prepend_file與auto_append_file用法實例分析
這篇文章主要介紹了PHP中auto_prepend_file與auto_append_file用法,較為詳細的講述了配置信息的休息以及函數(shù)的用法和注意事項,需要的朋友可以參考下2014-09-09
Zend?Framework框架等常用php框架中存在的問題
這篇文章主要介紹了Zend?Framework框架等常用php框架中存在的問題2008-01-01
php中如何使對象可以像數(shù)組一樣進行foreach循環(huán)
php中如何使對象可以像數(shù)組一樣進行foreach循環(huán)呢?下面小編就詳細的為大家介紹一下吧!需要的朋友可以 過來參考下2013-08-08

