This article mainly introduces how PHP can query different elements in two arrays. it involves related techniques of PHP array difference set calculation and array merge, for more information about how to use PHP to query different elements in two arrays, see the following example. We will share this with you for your reference. The details are as follows:
<? Php $ a = array ("success", "livechat_server_ip", "livechat_service_time", "abort_zh_cn", "abort_zh_tw", "abort_en_usa", "welcome_zh_cn", "success ", "welcome_en_usa", "timeout_zh_cn", "timeout_zh_tw", "timeout_en_usa", "Example", "absence_en_usa"); $ B = array ("example ", "livechat_server_ip", "livechat_service_time", "abort_zh_cn", "abort_zh_tw", "AB Ort_en_usa "," region "," timeout_zh_cn "," timeout_zh_tw "," timeout_en_usa ",); $ c = array_merge (array_diff ($, $ B), array_diff ($ B, $ a); print_r ($ c);?>
Result:
Array ([0] => absence_zh_cn [1] => absence_zh_tw [2] => absence_en_usa)