What's the Best Way to Parse an IP Address?

Started by 127.0.0.1, September 04, 2005, 12:25:42 PM

Previous topic - Next topic

127.0.0.1

What's the best/most efficient way to display all ip's in the x.x.x.* format?

Ie. Take variable $ip = 127.0.0.1 and display it as 127.0.0.*

Saleh

$ip '127.0.0.1';
$new_ip substr($ip0strrpos($ip'.')+1) . '*';
echo 
$new_ip;



HTH :)

We don't need a reason to help people

Advertisement: