I have the following array as I transform it into a string. This string would be used to save the products of the shopping cart in MySQL. Then they have several snacks and products:
products 5,2,5
use this code implode(',', $adicional);
Now the optional
8#-2:7#-1,8#-2:7#-1,8#-2:7#-1
each, and a snack and its optional
array
(
[8] => -2
[7] => -1
)
string: 8#-2:7#-1 // preciso da string de esse formato