我从数据库中获取数据,我想按字母顺序对hotel_name
进行排序。我怎么能用php的sort
函数或任何其他方法来做呢?
foreach($selData as $row)
{
$name=$row['hotel_name'];
$distance_colombo=$row['distance_colombo'];
$distance_airport=$row['distance_airport'];
$description=$row['description'];
$activities=$row['activities'];
$str=(explode(',',$activities));
print_r($str);
}