Trying to remove the comma that comes after the number 10. Tried every plausible workaround, but nothing's worked so far.
$i = 0;
while($i < 10) {
echo ++$i. ",";
}
Don't use a loop in the first place. Use implode()
to insert a delimiter between array elements.
echo implode(',', range(1, 10));