为什么数据用arsort排序没反应?
程序员文章站
2022-05-09 17:02:35
...
数组内容如下,是一位数组,数组名为$finalData。
Array ( [追求准确] => 1 [适应力强] => 2 [精于分析] => 2 [眼光广阔] => 2 [冷静自信] => 2 [体贴入微] => 2 [鞭策鼓励] => 2 [聪颖过人] => 2 [力争上游] => 2 [恪尽职守] => 2 [深明主次] => 2 [广纳意见] => 2 [忠于合作] => 2 [别具创意] => 2 [待人周到] => 2 [严于律己] => 2 [效率极高] => 2 [善于鼓励] => 1 [有魄力的] => 1 [有始有终] => 1 [努力推进] => 1 [富想像力] => 1 [不偏不倚] => 3 [颠覆性创新] => 1 [博闻好问] => 1 [见识广博] => 0 [逻辑清晰] => 0 [忠诚可靠] => 0 [观察入微] => 0 [善用机会] => 0 [别出心裁] => 0 [爽朗外向] => 0 [坦率直言] => 0 [注重细节] => 0 [坚持不懈] => 0 [令人信服] => 1 [踏实肯干] => 1 [敬业乐业] => 1 [注重现实] => 1 [信赖自己] => 1 [头脑精明] => 1 [专心致志] => 1 [技艺精良] => 1 [坚强不屈] => 1 [有条不紊] => 1 [专横跋扈] => 1 [吹毛求疵] => 1 [颇不耐烦] => 1 [争权结党] => 1 [反复无常] => 1 [退缩忍让] => 1 [粗心善忘] => 1 [畏首畏尾] => 1 [小题大做] => 1 [缺乏耐性] => 1 [冲动莽撞] => 1 [犹豫不决] => 1 [欠缺弹性] => 1 [刻板保守] => 1 [不思进取] => 0 [玩弄权术] => 0 [待人冷漠] => 1 [过于敏感] => 1 [口舌招尤] => 1 [不善委派] => 1 [抱残守阙] => 1 [猜忌多疑] => 1 [行动迟缓] => 1 [山头主义] => 1 [离经叛道] => 0 [不敢尝试] => 0 [不切实际] => 0 )
应用PHP的排序函数
但是最终得不到任何结果。
请问有谁遇到过这样的问题么?或者我的数组有什么问题么?
Array ( [追求准确] => 1 [适应力强] => 2 [精于分析] => 2 [眼光广阔] => 2 [冷静自信] => 2 [体贴入微] => 2 [鞭策鼓励] => 2 [聪颖过人] => 2 [力争上游] => 2 [恪尽职守] => 2 [深明主次] => 2 [广纳意见] => 2 [忠于合作] => 2 [别具创意] => 2 [待人周到] => 2 [严于律己] => 2 [效率极高] => 2 [善于鼓励] => 1 [有魄力的] => 1 [有始有终] => 1 [努力推进] => 1 [富想像力] => 1 [不偏不倚] => 3 [颠覆性创新] => 1 [博闻好问] => 1 [见识广博] => 0 [逻辑清晰] => 0 [忠诚可靠] => 0 [观察入微] => 0 [善用机会] => 0 [别出心裁] => 0 [爽朗外向] => 0 [坦率直言] => 0 [注重细节] => 0 [坚持不懈] => 0 [令人信服] => 1 [踏实肯干] => 1 [敬业乐业] => 1 [注重现实] => 1 [信赖自己] => 1 [头脑精明] => 1 [专心致志] => 1 [技艺精良] => 1 [坚强不屈] => 1 [有条不紊] => 1 [专横跋扈] => 1 [吹毛求疵] => 1 [颇不耐烦] => 1 [争权结党] => 1 [反复无常] => 1 [退缩忍让] => 1 [粗心善忘] => 1 [畏首畏尾] => 1 [小题大做] => 1 [缺乏耐性] => 1 [冲动莽撞] => 1 [犹豫不决] => 1 [欠缺弹性] => 1 [刻板保守] => 1 [不思进取] => 0 [玩弄权术] => 0 [待人冷漠] => 1 [过于敏感] => 1 [口舌招尤] => 1 [不善委派] => 1 [抱残守阙] => 1 [猜忌多疑] => 1 [行动迟缓] => 1 [山头主义] => 1 [离经叛道] => 0 [不敢尝试] => 0 [不切实际] => 0 )
应用PHP的排序函数
$finalData= arsort($finalData);print_r($finalData);
但是最终得不到任何结果。
请问有谁遇到过这样的问题么?或者我的数组有什么问题么?
回复讨论(解决方案)
arsort($finalData);print_r($finalData);//arsort返回值:是否排序成功,而不是排序成功后的数组
推荐阅读
-
我为什么没有用lucene的score来排序 lucene数据挖掘Google
-
我为什么没有用lucene的score来排序 lucene数据挖掘Google
-
先排序然后union all失效,mysql数据库多个表union all查询并排序的结果为什么错误
-
小弟我用jquery的AJAX通过POST过来数据 appliction/json-rpc 接收不到,这是为什么?
-
为什么小弟我用php代码插入数据到mysql中 显示为空
-
为什么用SQL语句不能添加数据库表数据,哪个大哥帮忙看下呗!
-
为啥数据用arsort排序没反应
-
小弟我用jquery的AJAX通过POST过来数据 appliction/json-rpc 接收不到,这是为什么?
-
这是什么东东,小弟我用thinkphp为什么只能往数据库添加一条信息
-
为什么用curl或file_get_content抓取不到数据。解决方案