I have this PHP code:
foreach( $wpdb->get_results(
) as $key => $row) {
echo "['". $row->DATE . "',". $row->total_sales . "],";
}
That produces this:
['09-08-11',0],['09-09-11',0],['09-10-11',0],['09-11-11',0],
How do I remove the last comma in the foreach loop?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…