|
|
|
| Ответ 001 на задачу N 12.
С условиями задачи можно ознакомится по ссылке.
<html>
<title></title>
<head>
<META http-equiv=content-type content="text/html; charset=windows-1251">
<style>
A:link {color: #000000; text-decoration: underline; font-family: tahoma; font-size: 11px; font-weight: normal};
A:visited {color: #000000; text-decoration: underline; font-family: tahoma; font-size: 11px; font-weight: normal};
A:hover {color: #000000; text-decoration: none; font-family: tahoma; font-size: 11px; font-weight: normal};
</style>
</head>
<body>
<CENTER>
<?
if (isset($_GET['start']) && is_numeric($_GET['start'])){
$start = $_GET['start'];
}
$file = file("data.txt");
$count = count($file);
$file = array_reverse($file);
if (empty($start) || $start < 0) $start = 0;
for ($i = 0; $i < ceil($count / 10); $i ++){
$num = $i * 10;
if ($num != $start){
echo "<a href=".$_SERVER['PHP_SELF']."?start=".$num."><B>".($i + 1)."</B></a> ";
} else {
echo "<font size=2>".($i + 1)."</font> ";
}
}
if ($count > $start + 10){
$count = $start + 10;
}
?>
<BR>
<?
for ($i = $start; $i < $count; $i ++){
echo $file[$i]."<BR>";
}
?>
</CENTER>
</body>
</html>
|
http://www.softtime.ru/info/task.php?id_article=82 | |
|
|
|
|
|
|
|
для: SoftTime
(15.03.2006 в 14:50)
| | А что... компактно, душевно... скрипт прекрасно справляется со своей функцией, не зависит от имени файла в котором расположен. | |
|
|
|