我需要从smarty
中的给定网址获取最后一个值My url : http://localhost/htdocs/cscart_mutli_car/electronics/computers/desktops/
I need to get "desktops" from the above url
我该怎么做?请帮帮我。
答案 0 :(得分:0)
请尝试
{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}