I have two arrays and I need to compare that and return matched value from array1. Please refer my code below,
$array1 = array(\"a\" => \"Green\", \"Red\"
This is because you put all values to lowercase. Just change to array_uintersect() and use strcasecmp() as callback function to compare them case-insensitive, like this:
$result = array_uintersect($array1, $array2, "strcasecmp");
output:
Array ( [a] => Green [0] => Red )