Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP上对数组中的值进行排序_Php_Arrays - Fatal编程技术网

在PHP上对数组中的值进行排序

在PHP上对数组中的值进行排序,php,arrays,Php,Arrays,我在php上有一个数组: Array ( [googlewindow] => 1 [google] => 6 [kei] => 1 [uutntpzlfcewtgfer] => 2 [dbq] => 2 [kexpi] => 1 [kcsi] => 1 [e] => 8 [ei] => 1 [expi] => 1 [ml] => 1 [function] => 5 [khl] => 1 [es] => 1 [ti

我在php上有一个数组:

Array ( [googlewindow] => 1 [google] => 6 [kei] => 1 [uutntpzlfcewtgfer] => 2 [dbq] => 2 [kexpi] => 1 [kcsi] => 1 [e] => 8 [ei] => 1 [expi] => 1 [ml] => 1 [function] => 5 [khl] => 1 [es] => 1 [time] => 2 [return] => 1 [new] => 3 [date] => 2 [gettime] => 2 [log] => 1 [b] => 2 [d] => 2 [c] => 6 [var] => 5 [a] => 12 [image] => 1 [g] => 3 [lc] => 2 [f] => 4 [li] => 3 [onerror] => 1 [onload] => 1 [onabort] => 1 [delete] => 1 [gen] => 1 [atyp] => 1 [i] => 1 [ct] => 1 [cad] => 1 [zx] => 1 [src] => 1 [toolbelt] => 1 [window] => 3 [sn] => 1 [webhp] => 1 [timers] => 1 [load] => 1 [t] => 1 [start] => 1 [try] => 1 [catch] => 1 [u] => 1 [jsrt] => 1 [kill] => 1 [gjwl] => 3 [location] => 1 [gjuc] => 1 [href] => 2 [indexof] => 4 [if] => 3 [substring] => 2 [q] => 2 [-] => 1 [for] => 1 )
如何使用FOR或WHILE指令从MAX到MIN排序,然后打印结果?谢谢

看看:

此函数用于对数组进行排序,以使数组索引与与其关联的数组元素保持相关性。这主要用于对实际元素顺序重要的关联数组进行排序时

PHP有很多功能。

请看:

此函数用于对数组进行排序,以使数组索引与与其关联的数组元素保持相关性。这主要用于对实际元素顺序重要的关联数组进行排序时


PHP有很多功能。

PHP拥有大量内置函数,其目的是使用它们,而不是自己编写代码,这几乎总是比较慢/效率较低。PHP拥有大量内置函数,其目的是使用它们,而不是自己编写代码,这几乎总是比较慢/效率较低。