So i have 2 POSTs coming as arrays:
$ post1 Array ( [0] => Tipul1 [1] => tipul2 [2] => tipul3 )
$ post2 Array ( [0] => cant1 [1] => cant2 [2] => cant3 )
What I want to achieve is send these in a db(the query wont be a problem) in this format(the format is a problem and the way I concatenate the values):
Tipul 1 - cant1 | Tipul 2 - cant2 | Tipul 3 - cant3
So , how can I combine those arrays and add the -
between each value ?
Using
foreach ($tip as $tipq) {
foreach ($cantitate as $cantitateq) {
echo $tipq.''.$cantitateq. "<br>";
}
}
I would get this(it makes sense): Tipul1cant1 Tipul1cant2 Tipul1cant3 tipul2cant1 tipul2cant2 tipul2cant3 tipul3cant1 tipul3cant2 tipul3cant3