php homemade small paging code

WBOY
Release: 2016-08-08 09:27:21
Original
1066 people have browsed it
<?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>
Copy after login

The above introduces the PHP self-made small paging code, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!