I have array values in single array and I need to intersect the arrays inside the main array.
Here is my code:
$a[1] = array ( 'value' => 'America','value1' => 'England1','value2' => 'Australia','value3' => 'England','value4' => 'Canada', );
$a[2] = array ( 'value' => 'America','value1' => 'Wales','value2' => 'Australia','value3' => 'England1','value4' => 'Canada', );
$a[3] = array ( 'value' => 'America','value1' => 'England','value2' => 'Australia','value3' => 'England1','value4' => 'Canada', );
I need to show the intersect values in the array. I need the result as follows:
Array
(
[value] => America
[value1] => England1
[value2] => Australia
[value4] => Canada
)
I can't check with this array with array_intersect()
function. because array keys are coming in dynamically.
This is just a sample. It goes like:
$a[1],$a[2],$a[3].....$a[n]
So please suggest any solution for this.