I need to merge following two arrays into a single array.
It looks like array_merge
not support multiple dimensional array.
Courses
Array (
[0] => Array ( [Name] => Course1 [CourseId] => 1 [Selected] => )
[1] => Array ( [Name] => Course2 [CourseId] => 2 [Selected] => )
[2] => Array ( [Name] => Course3 [CourseId] => 3 [Selected] => )
[3] => Array ( [Name] => Course4 [CourseId] => 4 [Selected] => )
[4] => Array ( [Name] => Course5 [CourseId] => 5 [Selected] => )
)
TeacherCourses
Array (
[0] => Array ( [CourseId] => 1 [Selected] => selected)
[1] => Array ( [CourseId] => 2 [Selected] => selected)
[2] => Array ( [CourseId] => 3 [Selected] => selected)
)
I need this result
Array (
[0] => Array ( [Name] => Course1 [CourseId] => 1 [Selected] => selected)
[1] => Array ( [Name] => Course2 [CourseId] => 2 [Selected] => selected)
[2] => Array ( [Name] => Course3 [CourseId] => 3 [Selected] => selected)
[3] => Array ( [Name] => Course4 [CourseId] => 4 [Selected] => )
[4] => Array ( [Name] => Course5 [CourseId] => 5 [Selected] => )
)