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