Is there a way to use the PHP substr function in a template?
This for example works:
$var = '{username}'
echo $var
It will output the EE username.
But I tried different variations with substr and similar replace PHP functions and they will not work. Instead of trimming my username, it actually just trims the variable and EE ignores the value.
Example:
$var = '{username}'
$foo = substr($var, 5);
echo $foo;
This actually parses {username}, the variable instead of the actual username. It will output:
name}
It properly cut the first 5 characters, but not from my username, but the variable itself.
EE ignores the variables inside that string completely. I tried print, double quotes, and even using other PHP function to replace or cut the username. No luck.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.