I need to get the last value from the given url in smarty
My url : http://localhost/htdocs/cscart_mutli_car/electronics/computers/desktops/
I need to get "desktops" from the above url
How can i do that . Please help me.
Please try
{assign var="last_dir" value="/"|explode:$smarty.server.REQUEST_URI}
{assign var="last_key" value=$last_dir|count}
{assign var="last_dir" value=$last_dir[$last_key-2]}
{$last_dir}