I would like to separate array values echoed from foreach loop
<?php foreach($qty as $qty2): ?>
<?php foreach($qty2 as $q): ?>
<?php echo implode(",", $q); ?>
<?php endforeach ?>
<?php endforeach ?>
A PHP Error was encountered
Severity: Warning
Message: implode(): Invalid arguments passed
Without adding implode function, my values would normally like this
87 89 78
It looks confusing so I would like to output as
87, 89, 78
or
87 - 89 - 78
or
(87)(89)(78)
The idea is to show the users that they are different values from array
The qty array
Array ( [0] => Array ( [qty] => 24 ) [1] => Array ( [qty] => 24 ) [2] => Array ( [qty] => 24 ) )
Now I tried this
<?php foreach($qty as $qty2): ?>
<?php foreach($qty2 as $q): ?>
<?php echo $q . " , " ; ?>
<?php endforeach ?>
<?php endforeach ?>
Result
24 , 24 , 24 ,
There is always a trailing comma at the end
Any Ideas?