To check whether one PHP array is contained within another PHP array, you can use the following code:
if(array_intersect($array1, $array2) == $array1){
// $array1 is a subset of $array2
}Used here array_intersect() Use a function to compare two arrays and find their intersection. If $array1 is a subset of $array2, then their intersection should be equal to $array1.