<?php $externalContent = file_get_contents(‘http://checkip.dyndns.com/‘); preg_match(‘/Current IP Address: \[?([:.0-9a-fA-F]+)\]?/‘, $externalContent, $m); $externalIp = $m[1]; echo $externalIp;
时间: 2024-10-12 14:15:54
<?php $externalContent = file_get_contents(‘http://checkip.dyndns.com/‘); preg_match(‘/Current IP Address: \[?([:.0-9a-fA-F]+)\]?/‘, $externalContent, $m); $externalIp = $m[1]; echo $externalIp;