Fork me on GitHub

wild cards and if statements HELP!!  Bottom

  • hey all real fast one I need to know how to do a wild card statement in an if/elseif statment like so:

    Code

    <!--[if $pnChangeitems[pnChangeitems].0 == "prep"]-->
            <!--[pnml name="_PREP"]-->
            <!--[elseif $pnChangeitems[pnChangeitems].0 == "proced"]-->
            <!--[pnml name="_PROCED"]-->


    how do I match for "prep*"???




    Thanks all
    -SUNADMN
  • I have been looking for a way to do this and am not sure that a regex will work here as I have tried doing the standard ^prep to match anything that starts with that, but no dice. Anyone ever done this before??


    -SUNADMN
  • you could use the PHP substr() function...
  • figured it out finally since true regex is not supported inside Smarty, only the regex_replace is from what I could find, I ended up doing a >= "prep" and that did the trick so if anyone wants to know how to get this done that is the method.


    -SUNADMN

This list is based on users active over the last 60 minutes.