Visa ett inlägg
Oläst 2010-12-10, 00:31 #4
KarlRoos KarlRoos är inte uppkopplad
Har WN som tidsfördriv
 
Reg.datum: Jul 2007
Inlägg: 1 416
KarlRoos KarlRoos är inte uppkopplad
Har WN som tidsfördriv
 
Reg.datum: Jul 2007
Inlägg: 1 416
Precis som coredev säger så är det smartast. För att förklara med kod:
PHP-kod:
// Detta skall du cacha
$file 'hej.php';
$vars = array(
     
'hej' => 'WN är mysigt'
);

// Det nedan skall du ej cacha
$content file_get_contents($file);

foreach(
$vars as $key => $val){
     
$search[] = '{' $key '}';
     
$replace[] = $val;
}

echo 
str_replace($search$replace$content); 
KarlRoos är inte uppkopplad   Svara med citatSvara med citat