使用
$result = $contents->xpath("from");
后显示
Fatal error: Call to a member function xpath() on a non-object in D:\wamp\www\index.php on line 16自己知道原因是因为没有安装插件 求插件名不知道安装哪个php插件phpxpath插件
$result = $contents->xpath("from");
后显示
Fatal error: Call to a member function xpath() on a non-object in D:\wamp\www\index.php on line 16自己知道原因是因为没有安装插件 求插件名不知道安装哪个php插件phpxpath插件
<?php
$Y=date('Y');
$m=date('m');
$d=date('d')+1;
$url = "http://www.gewara.com/cinema/ajax/getCinemaPlayItem.xhtml?cid=64915153&mid=&fyrq=$Y-$m-$d";
//$url = "http://www.gewara.com/cinema/ajax/getCinemaPlayItem.xhtml?cid=64915153&mid=&fyrq=2013-01-25";
$useragent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; chromeframe/24.0.1312.56";
$ch= curl_init();
header("content-type:text/html;charset=utf-8");
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
$contents=curl_exec($ch);
curl_close($ch);
if(strpos($contents,"影院当前还没有更新排片!")!=false){echo '影院当前还没有更新排片!';exit;}
$result = $contents->xpath("");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>台州新时代电影</title>
<style type="text/css">
</style>
</head>
<body>
</body>
</html>具体怎么写呢 帮我改改呗~