How to check if two arrays matches with each other?
Code: Select all
$array = array("arts","photograph","drawing");
$patern = array("photograph","drawing");
if (in_array($patern, $array)) {
echo 'found';
}But this works if $pattern is just a value or string, like this,
Code: Select all
$array = array("arts","photograph","drawing");
$patern = "photograph";
if (in_array($patern, $array)) {
echo 'found';
}Many thanks if you have any idea.
Thanks,
Lau