PEARのHTMLテンプレートを使う
<html>
<head>
<title>PEARのHTMLテンプレートを使う</title>
</head>
<body>
<li>名前:{name}
<li>点数:{point}
<hr>
</body>
</html>
<?php
require_once "HTML/Template/IT.php";
$fname = "tempdata.txt";
$it = new HTML_Template_IT("temp");
$it->loadTemplatefile("temp.html", true, true);
$file = fopen($fname, "r");
while (list($name, $point) = fgetcsv($file, 1000, ",")) {
$it->setCurrentBlock("person");
$it->setVariable("name", $name);
$it->setVariable("point", $point);
$it->parseCurrentBlock("person");
}
fclose($file);
$it->show();
?>