What's My IP Address?

The following is your IPv4 address:

What's an IP address?

Computers that join IP based computer networks (such as the internet) are assigned IP addresses, these addresses are used to identify you on the network.

Code

This site uses PHP to fetch your IP address. Here's the code.

function get_client_ip() {
	if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
		$ip = $_SERVER['HTTP_CLIENT_IP'];
	} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
		$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
	} else {
		$ip = $_SERVER['REMOTE_ADDR'];
	}
	return $ip;
}

echo get_client_ip();

Comments

Be the first to comment.


Anonymous

A preview of the comment you're writing will go here. Please wait a few seconds after typing.