I'm sorry if the title might be a bit confusing. But here is my problem. I have the following array called classes:
Array
(
[0] => Array
(
[Name] => BE1A
[Department] => Emmen
)
etc.
And I have an array called Departments:
Array
(
[0] => Array
(
[Name] => 3 Receptie Emmen
[code] => Emmen
)
etc.
These arrays will be imported into my database. But first i need replace value department in array classes to the index of the row where classes.department==departments.code. This way I can link classes with departments by using a foreign key. So array classes should be:
Array
(
[0] => Array
(
[Name] => BE1A
[Department] => 0
)
etc.
Any ideas?