RE: [PHP-WIN] Strip text from HTML
| From: | Michael Rudel | Date: | Fri, 09 Mar 2001 22:42:38 +0000 |
| Subject: | RE: [PHP-WIN] Strip text from HTML | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-5925@lists.php.net to get a copy of this message | ||
Hi Mangiola,
yes you can.
If the html-document is local on your server, you can "fopen"
it an then parse line for line like this:
<?php
if ( $fp = @fopen( "path/to/my/file/plus-the.file", "r" ) )
{
while( ! feof( $fp ) )
{
$line = fgets( $fp, 4096 );
if ( ! strpos( $line, "<P>" ) === false )
{
echo $line;
break;
}
}
fclose( $fp );
}
?>
... And if it's on a remote Host, then do the same but with "fsockopen"
(find help in the php-manual/Network Functions).
Hope t'll help.
Greetinx,
Mike
Michael Rudel
- Web-Development, Systemadministration -
_______________________________________________________________
Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:mru@suchtreffer.de
internet: http://www.suchtreffer.de
_______________________________________________________________
-----Original Message-----
From: Mangiola Nunzio Datavia [mailto:NunzioM@Datavia.co.za]
Sent: Friday, March 09, 2001 2:01 PM
To: PHP Windows List (E-mail)
Subject: [PHP-WIN] Strip text from HTML
Hi
I'd like to strip the first paragraph
of a html document and display it.
basically the introduction and no more.
Is this possible?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net