Best practices - PHP rtrim() on Looping Recordset
What would be the best means to trim the last comma from a looping recordset result?
One option is putting the looped results in an array and then using the php rtrim() function.
echo rtrim($r_results, ',');
Would this be the best way or are there other options?
// Multiple Markers
var markers = [
$wa_startindex = 0;
$wa_startindex = $Locations->Index;
['<?php echo($Locations->getColumnVal("pageName")); ?>',<?php echo($Locations->getColumnVal("lat")); ?>,<?php echo($Locations->getColumnVal("lng")); ?>],
$Locations->moveFirst(); //return RS to first record
The goal being to get rid of that last comma after a group of bracketed results (......tions->getColumnVal("lng")); ?>],)