Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 454 Bytes

isp.md

File metadata and controls

16 lines (10 loc) · 454 Bytes

How to detect ISP with PHP?

Getting ISP (internet service provider) of a client is possible with using gethostbyaddr function which will attempt to retrieve clien't host by its IP address:

Simple example:

<?php

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);

echo $hostname;

But important for you to know is that relying on this is not always possible since the client may be logged in through VPN.