0

Is there a PHP variable that holds the page title?
I would like to get a hold of the title of the page that I at,(The text at the top of the browser) for later storage.
Thanks!

4
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by rouse
1

I don't if there is one but you can use this technique :-

<html>
<head>
<?php
include("somefile.php");
?>
<title><?php echo $page_title; ?></title>
</head>
</html>

The $page_title variable gets it's value from the included files.

Votes + Comments
useful
0

What do you mean 'for later storage'?

What he means is that is there a variable or function or anything else that can catch the page title and later store in a variable.

0

OK...

similar to a previous post:

<?php
$title = "blah blah blah";
?>
...
<head>
...
<title><?php echo $title;?></title>
...
</head>
<body>
<p>The title is <?php echo $title;?></p>
</body>
...
0

PHP is on server side and HTML page is on client. So practically impossible unless you do echo the variable either hold in session or file to include. Then keep modify that between pages!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.