PHP implements a method of querying two different elements in an array, PHP array _php tutorial

Source: Internet
Author: User

PHP implements a method to query two different elements in an array, the PHP array


This article describes the PHP implementation of querying two different elements in the array method. Share to everyone for your reference, as follows:

<?php  $a = Array (  "Max_allow_dialogs",  "Livechat_server_ip",  "Livechat_service_time",  " ABORT_ZH_CN ",  " ABORT_ZH_TW ",  " Abort_en_usa ",  " WELCOME_ZH_CN ",  " WELCOME_ZH_TW ",  " welcome_en _usa ",  " TIMEOUT_ZH_CN ",  " TIMEOUT_ZH_TW ",  " Timeout_en_usa ",  " ABSENCE_ZH_CN ",  " Absence_ Zh_tw ",  " Absence_en_usa "  );  $b = Array (  "Max_allow_dialogs",  "Livechat_server_ip",  "Livechat_service_time",  "ABORT_ZH_CN ",  " Abort_zh_tw ","  Abort_en_usa ",  " WELCOME_ZH_CN ",  " WELCOME_ZH_TW ",  " Welcome_en_usa ",  "TIMEOUT_ZH_CN",  "TIMEOUT_ZH_TW",  "Timeout_en_usa",  );  $c = Array_merge (Array_diff ($a, $b), Array_diff ($b, $a));  Print_r ($c);? >

Results:

Array (  [0] = ABSENCE_ZH_CN  [1] = ABSENCE_ZH_TW  [2] = Absence_en_usa)

More readers interested in PHP related content can view the topic: "PHP Primer for Object-oriented programming", "PHP String Usage Summary", "Php+mysql Database Operations Primer" and "PHP common database Operation Skills Summary"

I hope this article is helpful to you in PHP programming.

Articles you may be interested in:

    • Php method for querying and deleting multiple columns of data in a database (using array functions)
    • PHP query MySQL database and save the results to an array of methods
    • thinkphp data querying and iterating over an array instance
    • thinkphp query returns a simple field array method
    • PHP implementation of multi-conditional query by array (string segmentation)
    • PHP quickly queries the code of its parent key and parent key value in a multidimensional array based on the key name
    • PHP array Operations (ADD, delete, query, sort) function description
    • PHP methods for randomly dividing strings into arrays of different lengths
    • How PHP deletes repeating elements in an array
    • How to count the number of elements in a PHP array

http://www.bkjia.com/PHPjc/1102464.html www.bkjia.com true http://www.bkjia.com/PHPjc/1102464.html techarticle PHP Implementation of the query two array of different elements of the method, the PHP array in this article describes the PHP implementation of the query two array of different elements of the method. Share to everyone for your reference, as follows ...

  • 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.