php function Array_merge () Usage example (merging homogeneous arrays)

Source: Internet
Author: User
  1. $arr 1 = $dblink->mem_fetch_array ("Select T_pid,imgname,invented,score from ' t_sum_giftimg ' where t_pid=3 or t_pid=6" , 0);
  2. $arr 2 = $dblink->mem_fetch_array ("Select T_pid,imgname,invented,score from ' t_sum_giftimg ' where t_pid=10 or t_pid=1 2 ", 0);
  3. $imgInfo = Array_merge ($arr 1, $arr 2);
  4. if ($imgInfo) {
  5. foreach ($imgInfo as $imgInfo) {
  6. $imgs [] = $imgInfo;
  7. }
  8. }
Copy Code

you may be interested in the article:PHP creates an array of methods introduced PHP uses Array_unique to determine if the same value exists in the array php array function In_array () Find out if there is a specified value in the array php array function array_key_ Exists () find the array key name if there is a small example of php array de-weight for a small example of PHP arrays and loops enhanced version of the Array_unique function (supports two-dimensional array) PHP array callback filter function Array_filter () Examples of applications PHP extracts variables from an array of functions and application examples of PHP code that randomly extracts some elements from an array using PHP arrays to automatically link code to the content of the article php add and delete array elements method

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.