La función te queda asi:
Código PHP:
function retornar($file){
global $variables , $valores;
$file = $_SERVER["DOCUMENT_ROOT"] ."/". $file;
if ($debug) echo $file;
$gestor=fopen($file,r);
$archivo=fread($gestor, 1024);
fclose($gestor);
return stripcslashes(
preg_replace(
$variables ,
$valores ,
$archivo )
)
);
}
Saludos,