So, if you are looking to make a basic IP grabbing tool in PHP or something that requires you to get the user's IP address then all you have to do is:
PHP Code:
$_SERVER['REMOTE_ADDR']
This is actually the most secure way of getting the IP of the visitor/user, and a way to validate this IP address is:
PHP Code:
filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP).