Capture the HTML content of the web page with the PHP programming language
first, put some smaller programs, but the function and actual effects need to be improved.
(1), use PHP to get web content
>! -- m -->http://hi.baidu.com/quqiufeng/blog/item... E7150.html1,
$xhr = new COM (.Quot; MSXML2.XMLHTTP.quot;);
$xhr-.gt; open. .quot; http://www.blogjava.net/pts.quot;
echo file_get_contents ($url);
.Gt; [/code]
3, fopen (). 1, 10);
Fclose ($stream);
}
if ($stream = fopen ('http://www.sohu.net','r')) {
/ > 5. Class= "postlink" href= "http://www.blogjava.net/pts/archive/2007/08/26/99188.html" >http://www.blogjava.net/pts/archive/200... 99188.html
simple practice:
[code].lt;? Php
$url=.quot;
or:
[code].lt;?
if ($stream = fopen) {
/ / print all. / / / / print the first 5 bytes
echo stream_get_contents ($stream, 5);
Fclose ($stream);
}
G.chinaunix.net/u1/44325/showart_348444.html
[code].lt;?
$my_book_url='http://book.yunxiaoge.com/files/article/html/4/4550/index.html';
ereg (.Quot; http://book.yunxiaoge.com/files/article/html/.#91; 0-9.#93; /. $myBook.#91; 0.#93;;
$file_handle = fopen ($my_book_url,.Quot; r.quot;); / / / / read the file
unlink (.Quot; test.txt.quot;); Ml.quot; $line, $reg);
$handle = fopen (.Quot; test.txt.quot;'a');
if ($line1) / >; $my_book_txt_url);
$my_book_txt_over_url=.quot; $my_book_txt$my_book_txt_url.quot; / / / / / / / / / / / >
echo.Quot; $my_book_txt_over_url.lt; /p.gt;.Quot; / / / / / > $file_handle_txt = = / / / / / read converted grasp. Take the address
while (! Feof ($file_handle_txt)) {
$line_txt = fgets ($file_handle_txt);
$line1=ereg (.Quot; ^.amp; $file_handle_txt); / / / / Amp; nbsp;.Amp; nbsp;.Amp; nbsp;.Quot;.Quot;.Quot; $my_over_txt); Br / > $my_over_txt=str_replace (.Quot;.Amp; quot;.Quot;.Quot;.Quot; $my_over_txt);
if ($line1) / > >fclose ($file_handle); / / close file
echo.Quot; finish.Lt; /p.gt;.Quot;
.Gt; [/code]