In many public websites, the following IP segments are displayed as asterisks when the user's IP address is displayed. this effectively protects user privacy. I will summarize some examples below, let's take a look. Php regular format IP address, hide the last one. Example? Php... in many public websites, the following IP segments are displayed as asterisks when the user's IP address is displayed. this effectively protects user privacy. I will summarize some examples below, let's take a look.
Php regular format IP address, hide the last one.
Example
Example
How to hide the last or last segment of an IP address in php
"; Echo preg_replace ($ reg2," $1. $2. *. * ", $ ip); // The output result is 127. 0. *. *?>
Example
function suohao($phone){$p = substr($phone,0,3)."*****".substr($phone,8,3);return $p;}
Of course, we can replace arrays 2 and 3 with arrays separated by commas (,) or combine arrays 0 and 1.
Article address:
Reprint at will ^ please include the address of this article!