I have an array of arrays that look like this:
array(40) {
[0]=>
array(2) {
["id"]=>
string(2) "ta"
["size"]=>
int(2)
[1]=>
array(2) {
["id"]=>
string(2) "tq"
["size"]=>
int(4)
....
I want to be able to get all the sizes in a way that I can do a query like this:
IN (2,4)
so… For each array, get the size key: IN (size,size,size…)
Thanks!
You could do something like this:-
Then just pass
$sizesto yourINqueryedit
In response to your comment below, you can use
array_uniqueto remove duplicate sizes, eg: