Tide tableThe data is for reference only
Tide Time (Hrs) |
00:58 |
05:20 |
13:28 |
21:15 |
Tide height (cm) |
161 |
75 |
288 |
127 |
Time zone: -1000 (East 10th District) Tide height datum: 174CM below mean sea level
This is part of the source program. In order to make it easier to understand, a large part has been deleted. Only the content in the
div block is taken
First use file_get_content or curl to get the content part on the home page. I use curl.
Copy code
The code is as follows:
$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';
}
That’s it, no explanation required. If you know PHP, read the code and print it to see the effect.
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/942409.html
www.bkjia.com
truehttp: //www.bkjia.com/PHPjc/942409.htmlTechArticlephp regular matching method of div with class in html and selecting the content, classdiv This article describes the php regular matching How to create a div with class in html and select its content. Share with everyone...