是否有PHP命令 [英] Is there a PHP command to
问题描述
只是想知道对IP地址进行排序的最简单方法是什么?
是否有一种很好的排序方式可以让它们按顺序排列
asort()对第一个字符进行排序,以便当然不会这样做
-jools-
jo***@by.com 写道:
只是想知道什么是最简单的IP地址排序方式
是否有一种很好的排序方式可以让它们保持顺序
asort()对第一个字符进行排序,以便不是很好吗
课程
-jools-
你有没有想过输入
php排序ip地址
进入google然后按我感觉很幸运?
显然不是!
2008年1月7日星期一19:48:09 +0100,< jo *** @ by.comwrote:
>
只是想知道对IP地址进行排序的最简单方法是什么?b $ b有没有一种很好的排序方式可以让它们按顺序排列
asort()对第一个字符进行排序,以便当然不会这样做
将它们转换为数字(使用usort())?
< a rel =nofollowhref =http://nl2.php.net/manual/en/function.ip2long.phptarget =_ blank> http://nl2.php.net/manual/en/function .ip2long.php
http: //nl2.php.net/manual/en/function.long2ip.php
-
Rik Wasmus
.. oO(jo *** @ by.com)
>只是想知道对IP地址进行排序的最简单方法是
您可以将它们转换为long int,然后使用普通的数字排序。
Micha
Just wondering what the simplest way to sort IP addresses would be
Is there a good way to sort that keeps them in sequence
asort() sorts on the first character so that doesnt quite do it of course
-jools-
jo***@by.com wrote:Just wondering what the simplest way to sort IP addresses would be
Is there a good way to sort that keeps them in sequence
asort() sorts on the first character so that doesnt quite do it of
course
-jools-Did you wonder enough to type
php sort ip addresses
into google and then press I''m feeling lucky?
Obviously not!
On Mon, 07 Jan 2008 19:48:09 +0100, <jo***@by.comwrote:
>
Just wondering what the simplest way to sort IP addresses would be
Is there a good way to sort that keeps them in sequence
asort() sorts on the first character so that doesnt quite do it of courseConvert them to a number (using usort())?
http://nl2.php.net/manual/en/function.ip2long.php
http://nl2.php.net/manual/en/function.long2ip.php
--
Rik Wasmus
..oO(jo***@by.com)
>Just wondering what the simplest way to sort IP addresses would beYou could convert them to a long int, then use normal numeric sorting.
Micha
这篇关于是否有PHP命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!