I have an array of courses:
Array
(
[0] => BIOL-1108
[1] => BIOL-1308
[2] => BIOL-2401
[3] => BIOL-2402
)
And a multidimensional array of completed courses that looks like this:
Array
(
[course] => Array
(
[0] => Array
(
[course] => BIOL-2401
[title] => BIOL-2401 - Human Anatomy & Physiology I
[grade] => A
)
[1] => Array
(
[course] => HIST-1301
[title] => HIST-1301 - History of the U.S. I
[grade] => B
)
[2] => Array
(
[course] => MATH-0303
[title] => MATH-0303 - Intermediate Algebra
[grade] => F
)
[3] => Array
(
[course] => BIOL-1108
[title] => BIOL-1108 - Life Science I Lab
[grade] => B
)
[4] => Array
(
[course] => BIOL-1308
[title] => BIOL-1308 - Life Science I
[grade] => C
)
)
)
I want to echo only the course, title and grade if it exists in the first array. I think I am needing a foreach loop, but I'm stuck.
2401and1308?1108also exists in both.