php - Regex search for Smarty template -


i have fields names such as:

home_phone company_phone mobile_phone other_phone_c personal_phone_c 

and have smarty variable populate input values field values:

value="{$fields.{{$prefix}}_phone}" 

but ones suffix _c not outputting, since don't match pattern.

is there way append kind of regex values either end after phone or _c, like:

{$fields.{{$prefix}}_phone{regex | ($|_c$)}}" 

use this: .*_(?:phone|phone_c)$

it match desired strings, ends _phone or phone_c.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -