潮汐表数据仅供参考 潮时 (hrs)
00:58
05:20
13:28
21:15
潮高 (cm)
161
75
288
127
时区:-1000 (东10区) 潮高基准面:在平均海平面下174cm
这是源程序里边的一部分,为了容易看懂,删减了一大部分,只取 div块中的内容 首页先用file_get_content或curl获取内容部分,我用的是curl。
$ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, 1); curl_setopt( $ch, curlopt_header, 0 ); curl_setopt( $ch, curlopt_returntransfer, 1 ); curl_setopt( $ch, curlopt_postfields, $data ); $return = curl_exec( $ch ); curl_close( $ch ); $regex4=/.*?/ism; if(preg_match_all($regex4, $return, $matches)){ print_r($matches); }else{ echo '0'; } 这样就可以了,不多解释,懂php的看代码,打印看一下效果。