- 分享
- 0
- 人气
- 0
- 主题
- 2
- 帖子
- 45
- UID
- 82425
- 积分
- 39
- 阅读权限
- 11
- 注册时间
- 2007-6-16
- 最后登录
- 2012-2-15
- 在线时间
- 126 小时
|
本帖最后由 alanlai12345 于 2010-11-2 11:42 PM 编辑
回复 46# weeming21
谢谢weeming21兄的指点
preg_match_all("/<span id=\"yfs_l10_4707.kl\">(.*)<\/span>/", $homepage, $array)
想在这里请问下,如何做到像tomato兄的演示例子?(除了share price,还有trade time,change。。。)
是用两个for loop和preg_match_all 来做吗?还是一只重复preg_match?
还有就是如果我们要把这些preg_match到的value放进table里的话。。。要如何做到呢?- <table width="530" border="2">
- <tr>
- <th scope="col">STOCK CODE</th>
- <th scope="col">NAME</th>
- <th scope="col">REF</th>
- <th scope="col">HIGH</th>
- <th scope="col">LOW</th>
- <th scope="col">LAST</th>
- <th scope="col">CHANGE</th>
- <th scope="col">VOLUME</th>
- </tr>
- <tr>
- <td>4707</td>
- <td>NESTLE</td>
- <td>(this is example that i would like to put in the value into this section which i have preg_match earlier, is that possible?)</td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- </tr>
- </table>
复制代码 |
|