我有这样的数据
array([0] => stdClass Object ( [id] => 1 [title] => AAAA [sentence] => abcdefgh [rank] => 3 ) [1] => stdClass Object ( [id] => 2 [ title] => BBBB [sentence] => ijklmn [rank] => 1 ) [3] => stdClass Object ( [id] => 3 [title] => CCC [sentence] => opqrstu [rank] => 2 ));
显示数据:
foreach($data as $d)
{
$title = $d->title;
$sentence = $d->sentence;
$rank = $d->rank;
echo $title. " | " .$sentence. " | " .$rank. "<br>";
}
如何按“排名”对其进行排序?谢谢你的帮助。