Hi all,

I have a little dilemma on my hands that I can't seem to solve. Iv'e looked
through the PHP Manual at the fread(), fgets(), fopen(), file() etc
functions which I beleive are capabile of what I want to do, but I just
can't seem to peice it all together.

Anyway, the following code is inside of home.php:

<?php
$title = "Home page of the website";
?>
<p>Welcome to the home page of our website.</p>
<p>Blah, blah and more blah!</p>

And the following code is inside of index.php:

<html>
<head>
<title><?php echo $title; ?></title>
</head>
<body>
<?php
require("home.php");
?>
</body>
</html>

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.

Any ideas greatly appreciated,
Thanks!

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

Reply via email to