佳音的博客

2008/01/12

格式化ip 然后比较

Filed under: Uncategorized — 佳音 @ 3:21 下午

好简单的代码 我怎么没想出来呢

$ip = “9.1.1.1″;
$ip=preg_replace(‘/(\d+)/e’,'sprintf(“%03d”,”$1″)’,$ip);

]]>

Powered by 00RZ