Re: Read a file, extract and echo some information
| From: | rush | Date: | Tue, 21 Oct 2003 14:16:19 +0000 |
| Subject: | Re: Read a file, extract and echo some information | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166954@lists.php.net to get a copy of this message | ||
"Php Webmaster" <phpwadmin@phpwebmaster.co.uk> wrote in message
news:20031020233506.78692.qmail@pb1.pair.com...
> Anyway, the following code is inside of home.php:
> As you can see, the above code will not work as the $title variable has
not
> been set yet. So, I need a way of opening up the home.php file, extracting
> the line containing the $title variable and putting that information
> inbetween the <title></title> tags.
I do not completely get why are you doing things the way you are doing and
what exactly you tra to accomplish, but I guess you could have home-head.php
that defines the varibale, and include that before you use title variable.
But it seems to me that in the longer run you could consider some php
template system to approach such problems.
rush
--
http://www.templatetamer.com/