将IP最后一位替换为星号 代码如下:
str = '1.1.1.1';reg = '/((?:\d+\.){3})\d+/';echo preg_replace(reg, "\\1*", str);?>