(.*)Теги:|sU', $str, $res); $res = preg_replace('|', '
', '
'), array('', '', '', ''), $res)); echo '
Назад
'; } else { $p = isset($_GET['p']) ? intval($_GET['p']) : 1; $url = 'http://www.championat.com/articles/football/' . $p . '.html'; $str = file_get_contents($url); preg_match_all('||si', $str, $div); $div = $div[1]; unset($div[0]); unset($div[4]); $div = implode('', $div); preg_match_all('|(.*)|U', $div, $url); preg_match_all('||U', $str, $back); preg_match_all('||U', $str, $fwd); $nav = $back[1][0] . ' [ ' . $p . ' ] ' . $fwd[1][0]; $nav = str_replace(array(' title="Следующая страница"', ' title="Предыдущая страница"'), array('', ''), $nav); $nav = preg_replace('|(.*)|U', '$2', $nav); $x=0; $cont = ''; while ($x<25) { $cont .= $x%2 ? '
' : '
'; $cont .= '
' . $url[1][$x] . '
' . PHP_EOL . '' . PHP_EOL; $x++; } echo preg_replace('|(.*)|U', "$2", $cont) . $nav; } require_once($rootpath . 'incfiles/end.php'); ?>