Portal Home > Knowledgebase > Articles Database > Is this possible? (automated browser title)
Posted by Mosqwik, 09-25-2007, 06:17 PM 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 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!
Posted by foobic, 09-25-2007, 09:29 PM You'd normally store the title information in the database and read it along with the rest of the page contents, but if you want to derive it automatically from the url you could use something like this: Translation: PHP_SELF is your url (/windows/atari2600/) explode on '/' to create an array of the individual path elements slice to remove blank first and last elements map ucfirst to capitalize first letters join array elements with > symbol HTH
Add to Favourites Print this Article