I have dynamic link build from variable :
/Tinkle/Matte/BlackHyper/Black/Gunmetal
How can I remove all text after variable value “BlackHyper” to become:
“/Tinkle/Matte/BlackHyper”
I try rtrim :
$param=”BlackHyper“;
$str=”/Tinkle/Matte/BlackHyper/Black/Gunmetal”;
rtrim($str,$param);
No luck , remove some letters….
RTrim doesnt work like this.
You need to do something like this
This will create a new string (there might be a bug or two I havent tested it) with all characters up to your param.