IPv4 and IPv6 PHP script

This is the php script for your webpage that can detect both Ipv4 and Ipv6 addresses in your internet connection.

An example can be seen below showing the script working. The result after the implementation of the script shows only IPv4 since i am only using that ip address on my internet.

You can also change some text in the script for your own preference.

You can download the PHP script here


  1. I don’t know how should I give you thanks! I am totally stunned by your article. You saved my time. Thanks a million for sharing this article.

  2. I really appreciate your professional approach. These are pieces of very useful information that will be of great use for me in future.


  3. Admin, if not okay please remove!

    Our facebook group “selfless” is spending this month spreading awareness on prostate cancer & research with a custom t-shirt design. Purchase proceeds will go to cancer.org, as listed on the shirt and shirt design.



  4. Very great post. I simply stumbled upon your blog and wanted to say that I have really enjoyed browsing your weblog posts. After all I’ll be subscribing on your feed and I am hoping you write again very soon!

  5. Very informative, keep posting such good articles, it really helps to know about things.