【发布时间】:2023-03-04 07:08:04
【问题描述】:
我需要从 smarty 中的给定 url 中获取最后一个值
My url : http://localhost/htdocs/cscart_mutli_car/electronics/computers/desktops/
I need to get "desktops" from the above url
我该怎么做。请帮帮我。
【问题讨论】:
-
这是您的 url 要求类别和子类别吗?
-
如果你 print_r($_REQUEST),你会得到什么?
-
不需要在 tpl 文件上显示桌面
-
提取
PHP中的片段(从$_SERVER['REQUEST_URI']获取),分配给你的Smarty对象,在模板中使用。