There are a lot of Threads about filtering, but i'm google all day long and can't get this to work.
I have an array, who is created thru a mysqli query.
$cat_cross =
array(2)
{ [0]=> array(3)
{ ["cat_cross_id"]=> string(2) "24"
["cat_cross_items_id"]=> string(1) "4"
["cat_cross_user_id"]=> string(2) "58"
}
[1]=> array(3)
{ ["cat_cross_id"]=> string(2) "25"
["cat_cross_items_id"]=> string(1) "6"
["cat_cross_user_id"]=> string(2) "58"
}
}
Now i want to get a query only with the values of "cat_cross_items_id" because i need this later to compare it in a if-clause with an other var.
I tried this one:
$allowed = array("cat_cross_items_id");
var_dump(array_intersect_key($cat_cross, array_flip($allowed)));
I think this works on the first level of array, but how i can filter the second on?
Desire Result:
$new_arr = array(4,6)
Thank you very much!