将最后一个ip替换为**


replace last ip with **

我希望能够替换最后两个八位字节之间的数字*类似192.168.10.129

to : 192.168.**.***

我需要regex来做到这一点。

preg_replace("/('d+'.'d+'.)'d+'.'d+/", "$1*.*", "192.168.10.129");

$temp_array=explose(".",$old_ip);

$new_ip=$temp_array[0]。'.'$temp_array[1]。'.'。str_repeat('*',count($temp_array[2])).'.'。str_re泥炭('*',计数($temp_array[3]))

+1代表创造力?