I want like theme or template untouched like default then other php can use it as their theme. but i have problem that i cant put theme to variable with generated before output print.
example here:
main code:
$word[0] = "test";
$word[1] = "hello word";
$word[2] = "example";
$word[3] = "wordwordword";
$word[4] = "variable";
while(5)
{
$name = "TEST".$word[$i];
output .= include("theme.php");
$i++;
}
echo "OUTPUT:";
echo "TITLE";
echo $output;
theme.php code:
hello <?php echo $name; ?>
NOTE: i know while loop will break but this is just example code. because i use while(mysql_fetch_array($result)). thanks
That code can’t possible work, so I reckon it’s pseudo code. Anyway, the issue is fixed with use of the ob_* functions in PHP, as follows. This is how the majority of template parsers in php work: