Re: document title
| From: | Sebastian Delmont | Date: | Thu, 30 Nov 2000 17:19:21 +0000 |
| Subject: | Re: document title | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28086@lists.php.net to get a copy of this message | ||
No... because actually, PHP know nothing about the contents, sintax or
semantics of an HTML document... Nor can you access some kind of buffer of
what has already been printed on a page...
So your only choice is something like
<?
$PageTitle = "My Page";
?>
<HEAD>
<TITLE><? echo $PageTitle; ?></TITLE>
</HEAD>
<BODY>
...
<? echo "This is page: " . $PageTitle; ?>
</BODY>
<samuel.luescher@gmx.net> wrote in message
news:3682.975604740@www25.gmx.net...
> Well ok, I think that would work, but actually, I'd rather not read in a
> file. I was thinking about something like an environment variable or
> something similar to $PHP_SELF, but containing the doc title.
> Isn't there anything like that?
>
> > // Get just title from HTML
> > $startstr = "<title>";
> > $endstr = "</title>";
> > $startstr = strpos($html_file, $startstr);
> > $endpos = strpos($html_file, $endstr);
> > $only_title = substr($html_file, $startpos + strlen($startstr),
> > ($endpos -
> > $startpos - strlen($startstr)));
> >
> > Hope it helps.
> >
> > Jay
> >
> > ----- Original Message -----
> > From: <samuel.luescher@gmx.net>
> > To: <php-general@lists.php.net>
> > Sent: Thursday, November 30, 2000 7:19 AM
> > Subject: [PHP] document title
> >
> >
> > > is there a way to retrieve the title of the current document (as
> > specified
> > > in the header)?
> > >
> > > --
> > > Sent through GMX FreeMail - http://www.gmx.net
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> > >
> >
>
> --
> Sent through GMX FreeMail - http://www.gmx.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>