I have two multidimensional arrays with me..
$a1= Array
(
[0] => Array
(
[sight_id] => 13
[location] => Jodhpur, Rajasthan, India
)
[1] => Array
(
[sight_id] => 14
[location] => Jodhpur Jn, Jodhpur, Rajasthan, India
)
[2] => Array
(
[sight_id] => 15
[location] => D-Kirtinagar, Jodhpur, Rajasthan, India
)
);
$a1= Array
(
[0] => Array
(
[sight_id] => 13
[location] => Jodhpur, Rajasthan, India
)
[1] => Array
(
[sight_id] => 14
[location] => Jodhpur Jn, Jodhpur, Rajasthan, India
)
[2] => Array
(
[sight_id] => 16
[location] => Jaisalmer, Rajasthan, India
)
[3] => Array
(
[sight_id] => 17
[location] => Fort Road, Amar Sagar Pol, Jaisalmer, Rajasthan, India
));
I want to split above given arrays into three different arrays..
$intersect_array=Array
(
[0] => Array
(
[sight_id] => 13
[location] => Jodhpur, Rajasthan, India
)
[1] => Array
(
[sight_id] => 14
[location] => Jodhpur Jn, Jodhpur, Rajasthan, India
));
$only_a1=Array(
[0]=> Array
(
[sight_id] => 15
[location] => D-Kirtinagar, Jodhpur, Rajasthan, India
));
$only_a2=Array(
[1] => Array
(
[sight_id] => 16
[location] => Jaisalmer, Rajasthan, India
)
[2] => Array
(
[sight_id] => 17
[location] => Fort Road, Amar Sagar Pol, Jaisalmer, Rajasthan, India
));
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…