im recieveing an output in the following format.When i foreach the loop only one id is iterated i need to combine these array into one single array so i can iterate all the ids.
Array
(
[0] => 6902680092829
)
Array
(
[0] => 6902680125597
)
Array
(
[0] => 6902680158365
)
Array
(
[0] => 6902680223901
)
Array
(
[0] => 6902680256669
)
i want to combine this array into one single array for eg:
array:{
0=>1,
1=>2,
2=>3
}
im adding shopify product id one by one to an array by doing this
$prdid=[];
array_push($prdid,$shopifyCustomers['body']['container']['product']['id']);
collection, that is why you should be using Laravel and droppingarray_xxxxxmethods (they are used behind scenes). So you can simply do$collection = collect(...$array1);and then, when you want to add another ID or whatever, just$collection->push($id);and that's it...