好吧,我想从其他网站(会员编号)中提取一个值。 就是这样:this
<?php
$CurlStart = curl_init();
curl_setopt ($CurlStart, CURLOPT_URL, "https://ffs-gaming.com/clans.php?
clanid=1264");
curl_setopt ($CurlStart, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($CurlStart, CURLOPT_REFERER, $url);
curl_setopt ($CurlStart, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U;
Windows NT 6.1; nl; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11");
curl_setopt ($CurlStart, CURLOPT_HEADER, 1);
curl_setopt ($CurlStart, CURLOPT_FOLLOWLOCATION, true);
$source = curl_exec ($CurlStart);
curl_close ($CurlStart);
$a=preg_match("/>Members.*.\n.*.>([0-9]*)</",$source,$b);
$members = $b[1];
echo "Members: $members";
?>
这是代码,我在一个论坛上发现它,修改它但它不起作用。
提前致谢!