难:求一段代码的正则
这2段代码是在html中,把html通过file_get_contents下载下来后提取其中的数据,网页地址:http://rate.taobao.com/user-rate-39512.htm
第一个是:提取其中的a标签中的 5810
5810
第二个是:提取其中的a标签中的 23510
23510
------解决方案--------------------
[User:root Time:19:35:14 Path:/home/liangdong/php]$ cat preg.php
<?php $str = <<<EOF
<a href="#" class="J_show_list J_MakePoint" data-point-val="tbrate.2.2.1" data-param='timeLine=-7&result=1'>5810
<a href="#" class="J_show_list J_MakePoint" data-point-val="tbrate.2.3.1" data-param="timeLine=-30&result=1">23510</a>
EOF;
preg_match_all('/<a. j_makepoint>(.*)/iUs', $str, $matches);
print_r($matches);
?> <div class="clear"></div></a.>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号