Re: cleaning HTML TAGS (headed)
| From: | Kevin Stone | Date: | Mon, 15 Jul 2002 20:33:56 +0000 |
| Subject: | Re: cleaning HTML TAGS (headed) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-107754@lists.php.net to get a copy of this message | ||
This isn't any more effective but it is fewer lines of code..
$file = implode('', file("file.html"));
preg_match('/<title>(.*)<\/title>/', $result);
$title = $result[1];
-Kevin
----- Original Message -----
From: "Juan Pablo Aqueveque" <juque@uct.cl>
To: <php-general@lists.php.net>
Sent: Monday, July 15, 2002 8:07 AM
Subject: [PHP] cleaning HTML TAGS (headed)
> Hi everyone.
> Sorry for the trivial question.
>
> I want insert a .html inside of one .php file but without <html><head> and
> <body> tags.
>
> I built a routine (shown it down) it's running OK but show me the title
> (<title>) of my html.
>
> somebody can help with a routine a little me more effective than mine?
>
> Thanks in advance.
>
> --jp
>
> > My Routine:
>
> if ($myFile = fopen("html.html","r"))
> {
> while(!feof($myFile))
> {
> $myLine = fgetss($myFile, 256,"<a><p>");
> $myLine = ereg_replace("\n","",$myLine);
> print($myLine);
>
>
> }
> }
> else
> {
> echo "file no found ";
>
> }
>
>
>
> ________________________________________________________
> Juan Pablo Aqueveque <juque@uct.cl>
> Ingeniero de Sistemas
> Departamento de Redes y Comunicaciones http://www.drc.uct.cl
> Universidad Católica de Temuco.
> Tel:(5645) 205 630 Fax:(5645) 205 628
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>