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

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -