The result of printing is multiple sibling array, first see, want to merge into a large array, easy to operate
Array ([0] = = Array ([title] + Yue Moving line) [1] = = Array ([title] = a tour is good) [2] = = Array ([title] + Tour Companion) [3] = = Array ( [title] [4] = = Array ([title] + Master explanation-Dashi solution) [5] = = Array ([title] = Take Me to fly) [6] = = Array ([title] = Musimin Homestay) [7] = = Array ([title] = Play Companion pet Travel) [8] = = Array ([title] = + Japan Deep Study Tour network) [9] = = Array ([ (Title] = Roaming live)) Array ([0] = = Array ([title] = Trip) [1] = = Array ([title] = Fast Travel) [2] = = Array ([title] + Independence Day travel) [3] = = Array ([title] = = BInk Ky Chuang Si Han Woo) [4] = = Array ( [title] + squid travel) [5] = = Array ([title] = with Kee Yoki) [6] = = Array ([title] = Met Rong) [7] = = Array ([title] + 23place) [8] = = Array ([title] = + Tour Will) [9] = = Array ([title] = Ouch travel))
Reply content:
The result of printing is multiple sibling array, first see, want to merge into a large array, easy to operate
Array ([0] = = Array ([title] + Yue Moving line) [1] = = Array ([title] = a tour is good) [2] = = Array ([title] + Tour Companion) [3] = = Array ( [title] [4] = = Array ([title] + Master explanation-Dashi solution) [5] = = Array ([title] = Take Me to fly) [6] = = Array ([title] = Musimin Homestay) [7] = = Array ([title] = Play Companion pet Travel) [8] = = Array ([title] = + Japan Deep Study Tour network) [9] = = Array ([ (Title] = Roaming live)) Array ([0] = = Array ([title] = Trip) [1] = = Array ([title] = Fast Travel) [2] = = Array ([title] + Independence Day travel) [3] = = Array ([title] = = BInk Ky Chuang Si Han Woo) [4] = = Array ( [title] + squid travel) [5] = = Array ([title] = with Kee Yoki) [6] = = Array ([title] = Met Rong) [7] = = Array ([title] + 23place) [8] = = Array ([title] = + Tour Will) [9] = = Array ([title] = Ouch travel))
The array_column,php version requires 5.5 +
$arr1 = Array( Array ( 'title' => '悦动行出游', ), Array ( 'title' => 'A游不错', )); $arr2= Array( Array ( 'title' => '悠比旅行', ), Array ( 'title' => '快快旅行', )); var_dump(array_merge(array_column($arr1,'title'),array_column($arr2,'title'))); array(4) { [0]=> string(15) "悦动行出游" [1]=> string(10) "A游不错" [2]=> string(12) "悠比旅行" [3]=> string(12) "快快旅行"}
Using the Array_merge method
array_map(function($v){ return $v['title']; }, $arr);
Suppose you have two-dimensional arrays above that are $ARR1 and $ARR2, respectively.
First Use the function Array_column () that gets the value of the two-dimensional array column,
The value of the ' title ' field in two arrays is taken to two anonymous index arrays, respectively.
Array_column ($arr 1, ' title ');
Then use the Array_merge () array merge function to combine two numbers and:
$new _arr = Array_merge (Array_column ($arr 1, ' title '), Array_column ($arr 2, ' title '));