I have created a nice script that will convert the URL of my page: http//www.example.com/section/subsection/page_name_goes_here to a nice Breadcrumb, like this: Home > Section > Subsection > Page Name Goes Here. I used functions explode, str_replace and ucwords to separate all the strings, remove any spaces or underlines and make all strings uppercase.
All those words are LINKS directing to their respective paths. This works perfect as a practical dynamic breadcrumb and I am pretty happy with the results, but I've run into a problem.
If my page URL is for instance "http://www.example.com/section/index.php", it will output Home > Section > Index. There are two problems here. First, "Index" is supposed to be replaced with the word "Home". And second, in my Dynamic Breadcrumb, I will never want to make the last element in the array a link.
All I need is a function that can call the last element in my array, so I can work with it within my code and make the necessary changes to that last string in my breadcrumb.
Hopefully your help will solve this small bug and then I'll post my function here so others can use it if they find it useful.
Thank you for your help!