Problem with array comparison

Source: Internet
Author: User
Array alignment Problems
This post was last edited by u012984377 on 2014-08-08 11:21:42


Implementing string ' Off-road, City Sub ' (length=16)
Compared to the array of ' wjc_title ' and string ' 2 saloon Cars ' (length=13), see if there are conditions to meet,

What's up, just learning PHP soon
------Solution--------------------
Do not map, paste out your array.
What do you mean by satisfying the conditions?
------Solution--------------------

$ar 1 = Array (' A1 ', ' A2 ');
$ar 2 = Array (
Array (' wjc_id ' = ' + ', ' wjc_title ' = ' A1 '),
Array (' wjc_id ' = ' ~ ', ' wjc_title ' = ' Sfdsds '),
);

function foo ($item) {
Global $value;
return $value = = $item [' Wjc_title '];
}
foreach ($ar 1 as $value) {
Echo $value, ', Array_filter ($ar 2, ' foo ')? ' In ': ' Not ', php_eol;
}
A1 in
A2 not here.
  • 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.