<?
$arr = array("ya.ru", "rambler.ru");
$str = file_get_contents("./1.txt");
$file = file_get_contents("./dis.php");
(!file_exists("./dis.php")) ? die ("Нет шаблона!") : true;
function sov($up, $body, $foot){
global $file, $arr;
$lin = "";
for ($i=0; $i<count($arr); $i++){
$lin .= "<a href='http://".$arr[$i]."'>".$arr[$i]."</a><br>";
}
$data = str_replace("#title#", $up , $file);
$data = str_replace("#body#", $body, $data);
$data = str_replace("#url#", $lin, $data);
$data = str_replace("#footer#", $foot, $data);
return $data;
}
echo sov("title", $str, "footer");
?>