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

Popular posts from this blog

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -