首頁  >  文章  >  後端開發  >  php自製小型分頁程式碼

php自製小型分頁程式碼

WBOY
WBOY原創
2016-08-08 09:27:211062瀏覽
<?php 
ini_set(&#39;memory_limit&#39;,&#39;-1&#39;);
if(!$_GET[&#39;page&#39;])$line=1;
//fy//
else $line=$_GET[&#39;page&#39;];
$f=file("a.pdf");
if(count($f)>500)
{
	for($i=($line-1)*500;$i<$line*500;$i++) 
	{
		echo $f[$i]."<br>";# code...
	}
}
else 
{
	foreach ($f as $key) 
	{
		echo $key."<br>";# code...
	}
}
?>
<meta charset="utf-8">
<title>xiaoshuo</title>
<link rel="stylesheet" href="./assets/css/amazeui.min.css">
<div class="am-g">
  <div class=" col-md-8 col-sm-centered">
    <form class="am-form" action="#" method="get">
      <fieldset class="am-form-set">
        <input type="text" id="page" name="page" placeholder="页数">
      </fieldset>
      <div><button type="submit" class="am-btn am-btn-primary am-btn-block">走你</button></div>
    </form>
  </div>
</div>

以上就介紹了php自製小型分頁程式碼,包含了方面的內容,希望對PHP教學有興趣的朋友有幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
上一篇:php(4)——函數下一篇:php(4)——函數