他にどの用途が最も共通の関心を持っているかをユーザーが確認できるリストを作成したいと考えています。私はすでにすべてのクラスを作成しており、数値出力は正しいですが、リストを並べ替える方法がわからないため、共通の関心が最も高い (最も高い数値) 人がリストの一番上にあり、そうでない人はリストの一番上にあります。多くの (最も低い数字) が一番下にあります。
Web ページに値を挿入するための私のコードは次のようになります。
$currentUserInterest = $interestutil->getCurrentUserInterest()->interestlist;
$otherUsersInterest = $interestutil->getAllOtherUserInterest();
foreach ($otherUsersInterest as $key => $user)
{
$commonInterests =count($currentUserInterest) - count(array_diff($currentUserInterest, $user->interestlist));
echo "<li>" . $user->fname . " " . $user->lname ." $commonInterests gemeinsame Interessen</span>";
}
誰かが html/javascript/jquery/php を使ってこのリストをソートする方法を教えてくれたら、とても助かります。
感謝と乾杯
ユッチゲ