PHP-Code:
function tmpl($tmpl_path, $replacements='none') {
$tmpl_file = @fopen($tmpl_path, "r");
$tmpl_inhalt = fread($tmpl_file, filesize($tmpl_path));
fclose($tmpl_file);
if (is_array($replacements)) {
while (list($code, $replacements) = each ($replacements)) { # zeile 9
$tmpl_inhalt = str_replace($code, $replacements, $tmpl_inhalt);
}
}
return $tmpl_inhalt;
}
Warning: Variable passed to each() is not an array or object in c:\apache\htdocs\functions.php on line 9
PHP-Code:
echo tmpl('templates/partner/viewdata.temp', array('{vorname}' => $m_rows[vorname], '{nachname}' => $m_rows[nachname], '{email}' => $m_rows[email], '{klammid}' => $m_rows[klammid]));
auf phplib würde ich eigentlich gerne verzichten...
Kommentar