我正在使用给定的 php 代码从 mysql 数据库表中获取价格值
$sql="SELECT DISTINCT (price) FROM 'table' order by price asc";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res))
{
$price=number_format($row[price]);
}
$price=implode(',',$price);
结果是2,299,4,600,5,800,8,000,12,700,16,900,23,978,27,098
但我想将结果显示为
$2,500 or less,$5,000 or less,$7,500 or less,$10,000 or less,$15,00 or less,$20,000 or less,$25,000 or less,$30,000 or less
谁能告诉我如何解决这个问题