09/03/10 12:57:58
>>59
function convert() {
include func_get_arg(1);
return preg_replace(
'/\{([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\}/e',
'isset($$1) ? htmlspecialchars($$1, ENT_QUOTES) : \'undefined\';',
file_get_contents(func_get_arg(0)));
}
echo convert('template.html', 'data.php');