-3
I have the following array:
Array ( [0] => Array ( [setor_loja] => 43 [impressao] => (P) Pizza 2 + Pizza 2\n ) ) Array ( [1] => Array ( [setor_loja] => 83 [impressao] => Acai 300 ml\n ) [2] => Array ( [setor_loja] => 83 [impressao] => AA§ai 500 ml\n ) ) Array ( [3] => Array ( [setor_loja] => 33 [impressao] => Misto c/ ovo\n ) [4] => Array ( [setor_loja] => 33 [impressao] => Misto duplo\n ) )
I’d like the exit to be like this: (P) Pizza 2 + Pizza 2 n ( leave alone )
Finish 300 ml n + Açai 500 ml n ( leave together because these two products are from the same sector)
Mixed c/egg n + Double mixed n ( come out together as these two products are from the same sector)
I suggest formatting the output array in the same way as the input one, so it is clear.
– Isac
What about your code? Looks like you forgot to post it.
– Woss
vc just concatenate the output or generate a new array with all the elements of the sector?
– rray
How are you generating this
array
? The organization of its indexes are in sequence but still arearrays
distinct with different products.– Marcelo de Andrade
Hi, just concatenate the exit, then I’ll turn around. Hi Marcelo, this array is coming from a series of foreachs and selects to assemble it, a piece of code is this: $data[] = array( 'setor_loja'=>$setor_sector. $store, 'print'=>' . $product. ' n' );
– Weslley Dutra