How to get the visitor IP

You just need to use the following server PHP variable:

$_SERVER['REMOTE_ADDR']
Code language: PHP (php)

More info about Server Variables at PHP.net

About Ricard Torres

Senior Front-end Software Engineer at Netcentric, from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> if you need to.

*
*