Sorry.. I screwed up my preg_match string.  It should have $file as the
second parameter and also included an 'i' after the closing delimeter for a
case-insensitive search.

preg_match('/<title>(.*)<\/title>/i', $file, $result);

----- Original Message -----
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Juan Pablo Aqueveque" <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 2:33 PM
Subject: Re: [PHP] cleaning HTML TAGS (headed)


> 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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 <[EMAIL PROTECTED]>
> > 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
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to