Marcus
Well-known member
I want to return only full items from array1, when These according keys are values in array2. In the example below I want to return
These are the two Arrays:
Currently I just run a Loop, but would prefer a simple php function. Something like array_intersect_key($array1,$array2)
PHP:
[5] = {
user_id = 5
username = wolf
mail = wolf@mail.com}
These are the two Arrays:
PHP:
array1: [5] = {
user_id = 5
username = wolf
mail = wolf@mail.com},
[9] = {
user_id = 9
username = bear
mail = bear@mail.com}
PHP:
array2: Array(2,5)
Currently I just run a Loop, but would prefer a simple php function. Something like array_intersect_key($array1,$array2)