Sunday, January 24, 2010

Snoopy Prints PHP Programmers, Need Help, I Need To Read The First 2-3 Lines Of The Body Of A Html Page Inc The Title:?

PHP programmers, need help, i need to read the first 2-3 lines of the body of a html page inc the title:? - snoopy prints

I tried for 2 weeks, but can not:
\\ \\ \\ \\ \\ \\ \\ \\ U0026lt;? php
/ *
** HtmlSQL - Example 10
** Demonstrates how isolate_content "function"
* /
include_once ( "snoopy.class.php");
include_once ( "htmlsql.class.php");

) $ Wsql = htmlsql new (;
/ / Connect to a URL
if ($ wsql-> connect ( 'url', http://www.mysite.com/copyright.html ')) (
Printing Error "while connecting: '. $ Wsql-> error;
exit;
)
/ *
** Isolate_content works functions as the selection function,
** You can, however, the parties enter HTML personalized content between
** These two channels are used for the consultation process

Wsql $> isolate_content ( '\\ \\ \\ \\ \\ \\ \\ \\ u0026lt; body>', '\\ \\ \\ \\ \\ \\ \\ \\ u0026lt; / body>');
Wsql $> isolate_content ( '\\ \\ \\ \\ \\ \\ \\ \\ u0026lt;! - Table of Contents: s ...' \\ \\ \\ \\ \\ \\ \\ \\ u0026lt;! - End -> ');

/ / Get results in a table
foreach ($ wsql-> fetch_array () as $ row) (

print_r ($ row);
)

?>
Website Source:
http://www.lodel.org/doccodesource/lodel ...
Thank you in AD

1 comments:

Đỗ Trúc Thanh said...

Hello!
I wrote the script for you: http://dotructhanh.info/temp/20070826.ph ...

Save it in a PHP file and paste it into your page, you can adapt the following lines:

$ File = "test.htm" / / path to your file
Parse_html $ html = new ($ file);
$ Title = $ this-> get_html_title () / / string
lines = $ this-> get_some_lines (3) / / Get and add 3 rows in a table
echo "The file: \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; / b>". basename ($ file). "
";
echo "\\ \\ \\ \\ \\ \\ \\ \\ u0026lt b> Title: \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; / b>. $ title."
";
echo "\\ \\ \\ \\ \\ \\ \\ \\ u0026lt; fieldset> \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; legend> Content \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; / legend>". join ($ lines "
")." \\ \\ \\ \\ \\ \\ \\ \\ U0026lt; / fieldset> ";

Post a Comment