im working on a theme script and im having a few problems :bemused: it doesnt work cos i gotthe { and } in " " does anyone know how i can fix this? or a better way of doing theme/skin?
<?php
$news = mysql_query("SELECT * FROM `news` ORDER BY id DESC LIMIT 0,5") or die(mysql_error());
$news_start = "while ($row = mysql_fetch_array($news)) {";
$news_content = nl2br($row['content']);
$news_id = $row['id'];
$news_title = $row['title'];
$news_end = "}";
$search = array(
"{news_start}",
"{news_title}",
"{news_content}",
"{news_end}"
);
$replace = array(
$news_start,
$news_title,
$news_content,
$news_end
);
$template = file_get_contents( "template.html" );
$out = str_replace( $search, $replace, $template );
echo $out;
?>
🙂