我有这个数组:
Array ( [#LFC] => 1 [#cafc] => 2 [#SkySports] => 1)
如何在页面上显示这样的内容? (最好按如下值降序排列):
\#cafc (2), #LFC (1), #SkySports (1)
谢谢
最佳答案
arsort($arrayName);
接下来,iterate througth the array keys and values .
foreach($arrayName as $key => $value)
{
echo "$key ($value),";
}
关于php - 如何显示数组中的项目及其值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2721178/