Answers for "check if array 1 is present in array2 in php"

PHP
1

php get values that exist in both arrays

$a=["a","b","c","d","e"];
$b=["d","e","f","g"];
$inBothAndB = array_intersect($a, $b); // Array([3] => d [4] => e)
Posted by: Guest on October-13-2021

Code answers related to "check if array 1 is present in array2 in php"

Browse Popular Code Answers by Language