How do I get the last part of an ip address string in PHP -
How do I get the last part of an ip address string in PHP -
if have ip such as:
195.123.321.456
how 456
variable?
this should work you:
<?php $ip = "195.123.321.456"; $split = explode(".", $ip); echo $split[3]; ?>
output:
456
php
Comments
Post a Comment