Rookie PHP question
Many ways to do this... the first one I can think of is instead of using echo, concatenate all the results into a string, then remove the last ,
character.
Another way would be to use a for
loop instead of foreach
and then iterate to the size of $mykey_values
- 1 and then print the last one without a ,
. And I'm sure others will post other ways (maybe with real code too - my PHP is too rusty for me to risk a real code sample).