Clear questions and runnable code
get the best and fastest answer
actually i hadn't thought of the $10.45 case, but that's a key point. The upper/lower casing I picked was pretty much just an arbitrary definition of this quick & dirty template system. My rationale was all upper for the template vars so that they stand out more in the template. And all lowercase for the keys since variable/key names are typically lowercase. Also, lc'ing it makes it tolerant of typos like $FIRSt_NAME in the template.
As for what to do with unknown vars, i figured that leaving '$FOO' in there was better to make it obvious that it didn't match, whereas doing '' might not be noticed..
But both ways are up to the template authoer on how they prefer it to work..