Forum Moderators: coopster
Here's the scoop. I have a directory that I've built using a PHP script.
The URLs are much like those form Dmoz:
/cat/sub_cat1/sub_cat2/sub_cat3/sub_cat4/sub_cat5/
I would like to pull out the final sub_cat, strip off the underscore and add this to the title. I've managed to get the whole URL into the title without the slashes, but what I can't do is find a way to get the last category and strip off the underscores.
Any Ideas?
Thanks to you too. This forum is great. I'm feeling guilty as I am a huge PHP rookie and up to my eyeballs in work. I set up the earlier response and then had to modify things when my url rewrite proved too difficult to implement, so I have gone from getting the last directory to getting the last bit of the $page variable.
I'm going to play around with your example a bit too - I saw similar examples when googling, but truth be told got a little scared by the 'apparent complexity'.
Thanks again!