Perdonate l'intromissione...
a me questa roba funziona, magari ti aiuta:
index.php
Codice PHP:
<?php
define('TAG_START', '{');
define('TAG_END', '}');
$testo = <<<EOT
<table>
<tr>
<td>PRIMO TESTO a cui segue l'elenco:</td>
<td><a href=file.htm'>[b]Primo punto in elenco[/b]</a></td>
</tr>
{elenco}
<tr>
<td>SECONDO TESTO</td>
</tr>
</table>
EOT;
function AggiungiContenuto($marcatore, $contenitore){
$ret = $contenitore;
if(($pos = strpos($contenitore, $tagged = TAG_START.$marcatore.TAG_END)) !== false){
echo substr($contenitore, 0, $pos);
include $marcatore.'.php';
$ret = substr($contenitore, $pos + strlen($tagged));
}
return $ret;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Ex 1</title>
</head>
<body>
<?php
echo AggiungiContenuto('elenco',$testo);
?>
</body>
</html>
elenco.php
Codice PHP:
<?php
$voce = array('Voce 1', 'Voce 2', 'Voce 3');
foreach ($voce as $value)
echo <<<EOT
<tr>
<td>Commento:</td><td>[url='#']$value[/url]</td>
</tr>
EOT;
?>