Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
该变量$siteroot包含一个字符串,如下所示:
$siteroot
http://www.example.nl/folder/
要获得http://www.example.nl/部分,您可以使用:
{$siteroot|substr:0:22}
但我想跳过这部分并返回 /folder/
文件夹的长度未知。
{$siteroot|substr:22}
应该管用
{assign var="bar_at" value=$siteroot|strpos:"nl/"} {$siteroot|substr:$bar_at+2}