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

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

]]>