')); $text = substr($text, 0, strpos($text, '
')); $text = strip_tags($text, ""); $lf = array(" ","\r","\n","\t"); $text = str_replace($lf,"",$text); $text = trim($text); $out = preg_split("#(?=[\d]{1,2}\.[\d]{1,2}\.[\d]{4}\s+[\d]{1,2}:[\d]{2})#", $text, -1, PREG_SPLIT_NO_EMPTY); $ans = ""; for($i=1; $i 0) $out[$i] = trim($out[$i]); $text = $out[$i].$out[$i+1]; $date = trim(substr($text, 0, 16)); $text = preg_replace ('#]*>#is', '', $text); $text = substr($text, 16); $lnk = substr($text, 0, strpos($text, '')+4); $hd = "

".htmlspecialchars(strip_tags($lnk))."
"; $lnk = substr($lnk, 0, strpos($lnk, '>')+1)."Читать дальше..."; $lnk = str_replace("')+4); $text = trim($text); if(strlen($text) > 200) $text = substr($text, 0, 200)."..."; if (!empty($ans)) $date = "\n" . $date; $ans .= $date . $hd . htmlspecialchars($text) . "
" . $lnk . "

"; } //print $ans . "
"; $f = fopen($name,"w"); flock($f, LOCK_EX); fwrite($f, $ans); flock($f, LOCK_UN); fclose($f); }else return false; } $name = "anons_inform.txt"; if (!file_exists($name) || mktime() - filemtime($name) > 2 * 3600) getLinks($name); $f = file($name); //shuffle($f); srand ((float) microtime() * 10000000); $k = array_rand($f, 5); $out_f = $f[$k[0]] . $f[$k[1]] . $f[$k[2]]. $f[$k[3]] . $f[$k[4]]; $out_f = iconv("windows-1251", "UTF-8", $out_f); echo "
" . $out_f . "
"; ?>