php函數array_merge ()用法一例(合并同類數組)

來源:互聯網
上載者:User
  1. $arr1 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=3 or t_pid=6", 0 );
  2. $arr2 = $dblink->mem_fetch_array ( "SELECT t_pid,imgname,invented,score FROM `t_sum_giftimg` where t_pid=10 or t_pid=12", 0 );
  3. $imgInfo = array_merge ( $arr1, $arr2 );
  4. if ($imgInfo) {
  5. foreach ( $imgInfo as $imgInfo ) {
  6. $imgs [] = $imgInfo;
  7. }
  8. }
複製代碼

您可能感興趣的文章:php建立數組的方法介紹php使用array_unique判斷數組中是否存在相同的值php數組函數 in_array() 尋找數組中是否存在指定值php數組函數array_key_exists() 尋找數組鍵名是否存在php數組去重的小例子有關php數組及迴圈的小例子加強版的array_unique函數(支援二維數組)php數組回調過濾函數array_filter()的應用執行個體php從數組中提取變數的函數及應用執行個體從數組中隨機抽取一些元素的php代碼使用php數組為文章內容自動加連結的代碼php增加與刪除數組元素的方法

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.