<?php
// 采集首页地址
$url = "http://cn.jokes.yahoo.com/jok/index.html";
// 获取页面代码
$r = file_get_contents($url);
echo $r;
// 设置匹配正则
$preg='/<a href="http://cn.jokes.yahoo.com/(.*).html" class=list target=_blank>/isU';
// 进行正则搜索
preg_match_all($preg, $r, $title);
?>这段代码总是在preg_match_all这里出错
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in D:\wamp\www\1.php on line 10
请问如何解决?
// 采集首页地址
$url = "http://cn.jokes.yahoo.com/jok/index.html";
// 获取页面代码
$r = file_get_contents($url);
echo $r;
// 设置匹配正则
$preg='/<a href="http://cn.jokes.yahoo.com/(.*).html" class=list target=_blank>/isU';
// 进行正则搜索
preg_match_all($preg, $r, $title);
?>这段代码总是在preg_match_all这里出错
Warning: preg_match() [function.preg-match]: Unknown modifier '/' in D:\wamp\www\1.php on line 10
请问如何解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货