We can use $_SERVER variable to check the IP address. For example, $_SERVER[“REMOTE_ADDR”] would return the client’s IP address. $_SERVER variable is an array containing information such as script headers, paths, and locations.