<?php
$rows = array("125", "148", "157", "169", "185"); $all_ids = "";
foreach ($rows as $item){
$all_ids .= $item.", ";
}
$all_ids = substr($all_ids, -0, -2); echo $all_ids;
PD9waHAKICAgJHJvd3MgPSBhcnJheSgiMTI1IiwgIjE0OCIsICIxNTciLCAiMTY5IiwgIjE4NSIpOwogICAkYWxsX2lkcyA9ICIiOwogICBmb3JlYWNoICgkcm93cyBhcyAkaXRlbSl7CiAgICAgICRhbGxfaWRzIC49ICRpdGVtLiIsICI7CiAgIH0KICAgCiAgICRhbGxfaWRzID0gc3Vic3RyKCRhbGxfaWRzLCAtMCwgLTIpOwogICBlY2hvICRhbGxfaWRzOw==