Hello,
I've been reading through the documentation on modifying TV output and decided to enquire for some insight.
Essentially I have a TV that the user has to input a 3 digit (max) product code relating to a particular product. The TV is then used at a certain point to form part of a URL link string.
Depending on the country, the product code for an item may vary, thankfully only a few select items it seems.
Here is some psedudo code for my scenario:
[[*productcode]] = userinput;
if [[*productcode]] contains preceding 0 // e.g. '045' {
remove preceding 0; // will remove 0 to yield 45
}
else
return [[*productcode]];
Thanks
If you want to remove *all* leading zeros, this one-line snippet should be faster:
return (ltrim($input, '0'));