Rodolfo Bandeira
Home Blog Posts Photos Videos Github Contact
<< All Posts
How to sum a number to an IP Address using PHP?

Oct 14, 2013


Hi there!

Today I got a situation that I needed to sum a number to an IP Address. So.. check this simple solution to solve it using PHP:

<?php
echo long2ip( ip2long("192.168.23.2") + 1);
?>

You can see this code running in this website: http://codepad.org/oiAOiqmX

Rodolfo



<< All Posts

Previous post:
How to set up proxy in apt-get
Most recent post:
How to check listen process in your linux?

rodolfo.io 🇧🇷 🇨🇦

Runs on OpenBSD 🐡
Twitter Github Linkedin RSS