<?php
$fields = '';
$str = file_get_contents('../templates/report_' . $_GET["reportname"] . '.tpl');

preg_match_all('/\{\$.*.\}/', $str, $fields);
foreach ($fields as $part){
  //$fieldsmod = implode(',',$part);
  for ( $i=0;$i<=count($part);$i++ )
  {
    if ( (strpos($part[$i], 'Txt}') != false) and (strpos($part[$i], 'filter') == false) ) echo $part[$i] . '=' . $part[$i+1] . '<br>';
  }
} 

?>