我正在尝试 curl searchbug.com 以查看它是否返回短语:“VoIP(IP 语音,互联网电话)”如果返回,则 make $voip==TRUE;
这就是我所拥有的,并且我确信我在这里遗漏了一些东西。非常感谢我能得到的任何帮助!
$url = 'http://www.searchbug.com/tools/landline-or-cellphone.aspx?&FULLPHONE=2093201364';
$useragent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.3 Safari/533.2';
$ch = curl_init($link);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
if ($response="VoIP (Voice over IP, Internet Phone)") { $voip==True; }