php - Show part of a IP address -



php - Show part of a IP address -

85.124.99.2

how can hide lastly 2 numbers ip?

and create like:

86.124.xxx.xxx

wrote quickly

$ip = "85.124.99.2"; $parts = explode('.',$ip); $new_ip = $parts[0].'.'.$parts[1].'.xxx.xxx';

warning: should test length of parts before accessing $parts[n]

php string ip-address

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -