• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

PHP in_array or maching element's value in array

Hello, I'm trying to match element's value in array with in_array function as shown below.
It doesn't have to be in_array to acomplish this.
But, so far it doesn't work that I expected.
Please help.

Thank you.
$a = array("a", "b", "c");
$b = array("a", "z", "b",  "c", "d");
 
if (in_array($b, $a))
    echo "Found";
 
Actually, I need to acomplish:
 
"If ALL of $a array's elements found in array $b then reurn true."

Open in new window

0
eb110k
Asked:
eb110k
1 Solution
 
eb110kAuthor Commented:
Thank you for your quick response.
I found a perfect solution in the article.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now