文一个正则的问题 preg_match_all("/href\s*=\s*(['\"]?)(.+?)\\1/i",$str,$arr);print_r($arr[2]); 不知道为什么要加 PREG_SET_ORDER 属性,把结果聚在一起不是更容易处理吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 preg_match_all("/href\s*=\s*(['\"]?)(.+?)\\1/i",$str,$arr); print_r($arr[2]); 这个好像也不行,输出如下:Array( [0] => Array ( [0] => href=h [1] => href=h [2] => href=h [3] => href=h [4] => href=h [5] => href=h [6] => href="http://passport.baidu.com/?login&tpl=mn&u='+escape(location.href)+'" [7] => href=h [8] => href=/ [9] => href=/ [10] => href=h [11] => href="http://www.hao123.com" [12] => href=/ [13] => href=h [14] => href=h [15] => href=h [16] => href=/ [17] => href=h [18] => href=h [19] => href=h [20] => href=h ) [1] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => " [7] => [8] => [9] => [10] => [11] => " [12] => [13] => [14] => [15] => [16] => [17] => [18] => [19] => [20] => ) [2] => Array ( [0] => h [1] => h [2] => h [3] => h [4] => h [5] => h [6] => http://passport.baidu.com/?login&tpl=mn&u='+escape(location.href)+' [7] => h [8] => / [9] => / [10] => h [11] => http://www.hao123.com [12] => / [13] => h [14] => h [15] => h [16] => / [17] => h [18] => h [19] => h [20] => h )) PHP脚本中如何仿真SSH1登录和执行命令 把PHP作为脚本执行的问题! 求 PHP 正则匹配 table 属性 如何在一个表(题库)里随机抽出100个ID,且不重复 如何看出一个网站是用什么技术实现,用什么服务器和操作系统和数据库? 有错误,使用DOM控件编写一个PHP脚本来创建XML的输出 ?????请问这个错误如何解决???? 关于使用MYSQL的问题? 怎么会这样!! 消息通知数据结构 smarty的section循环问题 批量处理数据出错..~如何批量更新数据?
print_r($arr[2]);
这个好像也不行,输出如下:
Array
(
[0] => Array
(
[0] => href=h
[1] => href=h
[2] => href=h
[3] => href=h
[4] => href=h
[5] => href=h
[6] => href="http://passport.baidu.com/?login&tpl=mn&u='+escape(location.href)+'"
[7] => href=h
[8] => href=/
[9] => href=/
[10] => href=h
[11] => href="http://www.hao123.com"
[12] => href=/
[13] => href=h
[14] => href=h
[15] => href=h
[16] => href=/
[17] => href=h
[18] => href=h
[19] => href=h
[20] => href=h
) [1] => Array
(
[0] =>
[1] =>
[2] =>
[3] =>
[4] =>
[5] =>
[6] => "
[7] =>
[8] =>
[9] =>
[10] =>
[11] => "
[12] =>
[13] =>
[14] =>
[15] =>
[16] =>
[17] =>
[18] =>
[19] =>
[20] =>
) [2] => Array
(
[0] => h
[1] => h
[2] => h
[3] => h
[4] => h
[5] => h
[6] => http://passport.baidu.com/?login&tpl=mn&u='+escape(location.href)+'
[7] => h
[8] => /
[9] => /
[10] => h
[11] => http://www.hao123.com
[12] => /
[13] => h
[14] => h
[15] => h
[16] => /
[17] => h
[18] => h
[19] => h
[20] => h
))