Tuesday, February 9, 2016

Get external IP of a server machine in PHP




  1. $externalContent = file_get_contents('http://checkip.dyndns.com/');
    preg_match('/Current IP Address: \[?([:.0-9a-fA-F]+)\]?/', $externalContent, $m);
    $externalIp = $m[1];
    //AppleConnect Configuration
    $sugar_config['AppleConnectIpKey'] = $externalIp;  


  2.   

No comments:

Post a Comment