Smarty substr string skip first characters

Maarten Kuilman picture Maarten Kuilman · Nov 14, 2012 · Viewed 9.9k times · Source

The variable $siteroot contains a string that looks like:

http://www.example.nl/folder/

To get the part http://www.example.nl/ you use:

{$siteroot|substr:0:22}

But i want to skip this part and return /folder/

The length of the folder is unknown.

Answer

Eugene picture Eugene · Nov 14, 2012
{$siteroot|substr:22}

Should work