Test legend:
Rendering:
Implementation code:
/** * * @param $page 页码(1至正无穷) * @param $num 数据中多上行为一页 * @param $rows 数据的总行数 * @param $length 下标的最大长度 * @return array */ public function PageDate($page, $num , $rows , $length){ //初始化数据 $MaxPage = 0; //最大页码 $MinPage = 0; //最小页码 $ServerPage = 0; //下拉框中显示的页码 $PageData = array(); //全部的页码集合(用户下拉框选择) $PageShowData = array(); //用于显示下标的页码集合 $page = intval($page); if($rows == 0){ return $data = array( 'page' => $page, 'MaxPage' => $MaxPage, 'MinPage' => $MinPage, 'ServerPage' => $ServerPage, 'PageData' => $PageData, 'PageShowData' => $PageShowData ); } //得到最大分页和最小分页 $MaxPage = intval($rows / $num); $double = $rows % $num; if($double > 0.000000001) { $MaxPage += 1; } $MinPage = 1; $ServerPage = 1; //得到页码的全部项目 for($i = 1; $i <= $MaxPage; $i++ ){ $PageData[$i] = $i; } //对页码进行正确性改正 if($page < $MinPage){ $page = 1; } if($page > $MaxPage){ $page = 1; } /*生成显示的页码标签*/ //生成左侧的代码快 if($page == $MinPage){ $PageShowData[1] = $page; } if($page > $MinPage){ $PageShowData[1] = $MinPage; // $PageShowData[2] = $page - 1; // << $PageShowData[2] = '<<'; // << if($page -2 > $MinPage ){ $PageShowData[3] = $page - 2; $PageShowData[4] = $page - 1; }elseif($page -2 == $MinPage){ $PageShowData[3] = $page - 1; } //确定选中的页码代码快 $PageShowData[count($PageShowData) + 1] = $page; } $COUNT = count($PageShowData) + 1; //生成右侧的代码块 if($page == $MaxPage){ return $data = array( 'page' => $page, 'MaxPage' => $MaxPage, 'MinPage' => $MinPage, 'ServerPage' => $ServerPage, 'PageData' => $PageData, 'PageShowData' => $PageShowData ); } if($page < $MaxPage) { if($MaxPage - $page >= 2){ $j = 1; for($i = $COUNT; $i >$PageShowData[$COUNT] = '>>'; $PageShowData[$COUNT + 1] = $MaxPage; //得到选中的参数 $ServerPage = $PageShowData[$COUNT-1] + 1; if($ServerPage > $MaxPage){ $ServerPage = 1; } return $data = array( 'page' => $page, 'MaxPage' => $MaxPage, 'MinPage' => $MinPage, 'ServerPage' => $ServerPage, 'PageData' => $PageData, 'PageShowData' => $PageShowData ); } }
The above introduces the paging subscript generation code of the web page (PHP back-end method), including the content, I hope to be more familiar with PHP Tutorials are helpful for those who are interested.

The methods of building a website in HTML5 include: 1. Use semantic tags to define the web page structure, such as, , etc.; 2. Embed multimedia content, use and tags; 3. Apply advanced functions such as form verification and local storage. Through these steps, you can create a modern web page with clear structure and rich features.

A reasonable H5 code structure allows the page to stand out among a lot of content. 1) Use semantic labels such as, etc. to organize content to make the structure clear. 2) Control the rendering effect of pages on different devices through CSS layout such as Flexbox or Grid. 3) Implement responsive design to ensure that the page adapts to different screen sizes.

The main differences between HTML5 (H5) and older versions of HTML include: 1) H5 introduces semantic tags, 2) supports multimedia content, and 3) provides offline storage functions. H5 enhances the functionality and expressiveness of web pages through new tags and APIs, such as and tags, improving user experience and SEO effects, but need to pay attention to compatibility issues.

The difference between H5 and HTML5 is: 1) HTML5 is a web page standard that defines structure and content; 2) H5 is a mobile web application based on HTML5, suitable for rapid development and marketing.

The core features of HTML5 include semantic tags, multimedia support, form enhancement, offline storage and local storage. 1. Semantic tags such as, improve code readability and SEO effect. 2. Multimedia support simplifies the process of embedding media content through and tags. 3. Form Enhancement introduces new input types and verification properties, simplifying form development. 4. Offline storage and local storage improve web page performance and user experience through ApplicationCache and localStorage.

HTML5isamajorrevisionoftheHTMLstandardthatrevolutionizeswebdevelopmentbyintroducingnewsemanticelementsandcapabilities.1)ItenhancescodereadabilityandSEOwithelementslike,,,and.2)HTML5enablesricher,interactiveexperienceswithoutplugins,allowingdirectembe

Advanced tips for H5 include: 1. Use complex graphics to draw, 2. Use WebWorkers to improve performance, 3. Enhance user experience through WebStorage, 4. Implement responsive design, 5. Use WebRTC to achieve real-time communication, 6. Perform performance optimization and best practices. These tips help developers build more dynamic, interactive and efficient web applications.

H5 (HTML5) will improve web content and design through new elements and APIs. 1) H5 enhances semantic tagging and multimedia support. 2) It introduces Canvas and SVG, enriching web design. 3) H5 works by extending HTML functionality through new tags and APIs. 4) Basic usage includes creating graphics using it, and advanced usage involves WebStorageAPI. 5) Developers need to pay attention to browser compatibility and performance optimization.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!
