Quote:
Originally Posted by Mosqwik
Hi,
Something that would be really useful for a new project im working on would be to have automated browser titles using some php code in the <title> tags.
The only way I can think of doing this is by having the php code read the url im using for navigation, e.g. /windows/atari2600/ and use that data, edit it and have it display as 'Windows > Atari 2600'
Has this kind of thing been done before? are there any other common ways of doing this? Also are there any tutorials around?
Thanks!
|
Sure it is possible.
It honestly depends on the URL that you are trying to interpret.
In the case you gave above, you can pull those two words out and then create the custom title.
As far as the php code that you need to do this:
$_SERVER['REQUEST_URI'] - will pull the current URL
explode("/", $url) - this would put the different parts of the URL (windows, atari2600) into an array
Of course, there are going to be more than 1 way to accomplish this same thing, but do a quick google search for finding url with php and you can see some examples of what other people have done.
|