Thanks Sid.
Now, it is easier (can I avoid the callback function), if I put the vars into an array?
See, I want to stay away from str_replace, because it means I have to call it for each one or set them up individually.
I was thinking maybe:
$globals[main] = "main bit";
$globals[columnA] = "1";
then:
$txt=preg_replace("/[%(a-z+)%]/",$globals[$1],$tpl);
Would that work? To be fair - I tried it, it didn't. So the real question is, what's wrong with that?