如何取得server端對外的ip呢?以php為例

Posted by on | |

有好些網站提供取得您ip的服務,
我們只要呼叫它,就會告訴您呼叫端的ip囉!

底下是php碼的範例:




// 抓取 server IP 資訊
function getServerIP(){
    $html = file_get_contents('http://ip-addr.es/');
    return $html;
}


0 意見: