I have an array like this :
[input] => Array (
[0] => Array ( [val1] => 111 [val2] => 222 [val3] => 333 [day] => 444 )
[1] => Array ( [val1] => 111 [val2] => 221 [val3] => 333 [day] => 444 )
[2] => Array ( [val1] => 111 [val2] => 223 [val3] => 333 [day] => 444 )
[3] => Array ( [val1] => 111 [val2] => 224 [val3] => 333 [day] => 444 )
[4] => Array ( [val1] => 111 [val2] => 222 [val3] => 333 [day] => 444 )
)
I only want to check if the first 2 value (val1 and val2) in an array are identical to another array. Like input[0] and input[4] in the example above. How to I do this in php?
I don’t want to remove the duplicated array, I just only to return the duplicated value for further use.
thanks
You just need the array where you store those keys: