Unik sammensat array
Hvordan sammensætter jeg disse to arrays?Courses
Array (
[0] => Array ( [Name] => Fag1 [CourseId] => 1 [Selected] => )
[1] => Array ( [Name] => Fag2 [CourseId] => 2 [Selected] => )
[2] => Array ( [Name] => Fag3 [CourseId] => 3 [Selected] => )
[3] => Array ( [Name] => Fag4 [CourseId] => 4 [Selected] => )
[4] => Array ( [Name] => Fag5 [CourseId] => 5 [Selected] => )
)
TeacherCourses
Array (
[0] => Array ( [CourseId] => 1 [Selected] => selected)
[1] => Array ( [CourseId] => 2 [Selected] => selected)
[2] => Array ( [CourseId] => 3 [Selected] => selected)
)
Resultatet skulle gerne blive
Array (
[0] => Array ( [Name] => Fag1 [CourseId] => 1 [Selected] => selected)
[1] => Array ( [Name] => Fag2 [CourseId] => 2 [Selected] => selected)
[2] => Array ( [Name] => Fag3 [CourseId] => 3 [Selected] => selected)
[3] => Array ( [Name] => Fag4 [CourseId] => 4 [Selected] => )
[4] => Array ( [Name] => Fag5 [CourseId] => 5 [Selected] => )
)