程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> php 分頁類

php 分頁類

編輯:關於PHP編程

<?

  = 10; 

      = 10; 
      = 20; 

      =   =  Calculation_Page_Num( ->page_num = (  / -> -> Calculation_Min_Max(  = 1
         = 0 = 0
         = 0 = 0
         = 0 = 0
         ( ( ->page_num - ->page_max ) <= 0
             = 1 = ->
             = ->page_max % 2 (  === 1
                 =  = ( ->page_max - 1 ) / 2
                 = ->page_max / 2 - 1 = ->page_max / 2
             = 1 +  = ->page_num - 
             (  >=  &&  <= 
                 =  -  =  + 
                 ( (  -  ) <= 1
                     = 1 = -> = ->page_num - ->page_max + 1 = -> = ['min'] = ['max'] =  
     make_page( , , ,  = ->Calculation_Page_Num(  = ->Calculation_Min_Max(  (!("([?|&]=)",  = (,"?")===?."?":."&" = ."=0" (  >  = 
         = (  . '=[0-9]+',  . '=0',  =  = 0(  = ['min']; <= ['max'];++ (  == []['url'] = ''[]['name'] = []['no'] = []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] = ++ ( -> = ->make_before_next_link( , , ,  ( -> = ->make_first_end_link( , , ,  
     make_page_with_total( , , ,  = ->Calculation_Page_Num(  = ->Calculation_Min_Max(  (!("([?|&]=)",  = (,"?")===?."?":."&" = ."=0" (  >  = 
         = (  . '=[0-9]+',  . '=0',  =  = 0(  = ['min']; <= ['max'];++ (  == []['url'] = ''[]['name'] = []['no'] = []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] = ++ ( -> = ->make_before_next_link( , , ,  ( -> = ->make_first_end_link( , , , = (/->['total']=['DATA']= 
     make_before_next_link( , , ,  =  =  - 1 =  + 1 (  < 1 = 1[0]['url'] = ''[0]['name'] = "上一頁"[0]['no'] = [0]['url'] = (  . '=0',  . '=' . , [0]['name'] = "上一頁"[0]['no'] =  = (  = ( (  = 0; < ;++[]['url'] = []['url'[]['name'] = []['name'[]['no'] = []['no'++ (  > -> = ->[]['url'] = ''[]['name'] = "下一頁"[]['no'] = []['url'] = (  . '=0',  . '=' . , []['name'] = "下一頁"[]['no'] =  
     make_first_end_link( , , ,  =  = 1 = -> (  == 1 = 1[0]['url'] = ''[0]['name'] = "首頁"[0]['no'] = [0]['url'] = (  . '=0',  . '=' . , [0]['name'] = "首頁"[0]['no'] =  = (  = ( (  = 0; < ;++[]['url'] = []['url'[]['name'] = []['name'[]['no'] = []['no'++ (  == ->[]['url'] = ''[]['name'] = "尾頁"[]['no'] = []['url'] = (  . '=0',  . '=' . , []['name'] = "尾頁"[]['no'] =  
     make_page_with_points( ,,,,, = ->Calculation_Page_Num(  );        
         = ->Calculation_Min_Max(  );        
        (==0 ""(  >  = +1 = +1 ( 1:
                 = '前一頁' = '後一頁' 2:
                 = '<' = '>' 3:
                 = '<<' = '>>':
                 = '上一頁' = '下一頁' (!("([?|&]=)",  = (,"?")===?."?":."&" = ."=0"
         = (  . '=[0-9]+',  . '=0',  =  = -1 = +1
         (<= ( + 1
             ( == 1[0]['url'] = ''[0]['name'] = [0]['no'] =             
[0]['url'] = (  . '=0',  . '=' .( - 1), [0]['name'] = [0]['no'] = 
             = 1 ( = 1;  <= ; ++ ( != []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] =     
[]['url'] = ''[]['name'] = []['no'] = []['attr'] = 'current'++ = (
            ( == )    
[]['url'] = ''[]['name'] = []['no'] = []['url'] = (  . '=0',  . '=' .( + 1), []['name'] = []['no'] =   ( > ( + 1))
 ( <= ) 

                 ( == 1[0]['url'] = ''[0]['name'] = [0]['no'] =             
[0]['url'] = (  . '=0',  . '=' .( - 1), [0]['name'] = [0]['no'] = 
                 = 1 ( = 1;  <= ; ++ ( != []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] =     
[]['url'] = ''[]['name'] = []['no'] = []['attr'] = 'current'++ = (
                []['url'] = ''[]['name'] = '...'[]['no'] = ''
                [+1]['url'] = (  . '=0',  . '=' . , [+1]['name'] = [+1]['no'] = 
                [+1]['url'] = (  . '=0',  . '=' . ( + 1), [+1]['name'] = [+1]['no'] = 
 ( > ( - ))

                    [0]['url'] = (  . '=0',  . '=' .( - 1), [0]['name'] = [0]['no'] = 
                    [1]['url'] = (  . '=0',  . '=1', [1]['name'] = 1[1]['no'] = 1
                    [2]['url'] = ''[2]['name'] = '...'[2]['no'] = '' = 3 ( = ( -  + 1);  <= ; ++ ( != []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] =     
[]['url'] = ''[]['name'] = []['no'] = []['attr'] = 'current'++ = (
                    ( == )    
[]['url'] = ''[]['name'] = []['no'] = []['url'] = (  . '=0',  . '=' .( + 1), []['name'] = []['no'] = 

                    [0]['url'] = (  . '=0',  . '=' .( - 1), [0]['name'] = [0]['no'] = 
                    [1]['url'] = (  . '=0',  . '=1', [1]['name'] = 1[1]['no'] = 1
                    [2]['url'] = ''[2]['name'] = '...'[2]['no'] = '' ( = ( - ( - 2) / 2);  <= (+( - 2) / 2); ++ = ( ( != []['url'] = (  . '=0',  . '=' . , []['name'] = []['no'] =     
[]['url'] = ''[]['name'] = []['no'] = []['attr'] = 'current'++ = (
                    []['url'] = ''[]['name'] = '...'[]['no'] = ''
                    [+1]['url'] = (  . '=0',  . '=' . , [+1]['name'] = [+1]['no'] = 
                    [+2]['url'] = (  . '=0',  . '=' . ( + 1), [+2]['name'] = [+2]['no'] = 
 ?>

 

使用方法 :

 = ['page_no'] ? ['page_no'] : 1 = 20 = (-1)* =  +  = ->length = ->isFirstPage =  = ['SCRIPT_NAME']."?&a=". = ->make_page(,,,"page_no");

支持多種樣式:

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved