Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPÒ³Ãæ·ÖÒ³º¯Êý

 ºÜ¾ÃǰЩµÄһЩÎÄÕ£¬ÄÇʱºò¼¼Êõ»¹ÔÚ³õ¼¶½×¶Î£¬ÔÚÏÖÔÚ¿´À´´úÂë¹»Àõģ¬µ«ÊÇÈË×ÜÊÇÒ»²½²½×ßÉÏÀ´µÄ£¬Ï£ÍûÄܸø³õѧÕßÒ»µã¹ÄÀøÁË£¡
<?php
/*********************************************************
 filename£ºmulti.php
 describe£º ÏÔʾ¶àÓÚÒ»Ò³µÄÁ´½Ó
 function£º·ÖÒ³ÏÔʾģ¿é
 author£º  etongchina@gmail.com
 checked£º 2008-02-15 18:05
 µ÷Ó÷½Ê½£º
$num:Êý¾Ý¿â×ܼǼÊý
$perpage:ÿҳÏÔʾÌõÊý
$curr_page:µ±Ç°Ò³Âë
$mpurl:Á´½ÓµÄURL
$type:url¸ÄдºóµÄÁ´½Ó
ĬÈϹæÔòΪ£ºµ±Ç°Ò³Âë.htm
*********************************************************/
function multi($num, $perpage, $curr_page, $mpurl,$type = 0) {
 $multipage = '';
 if(!is_numeric($curr_page) || ( $curr_page < 1 )){
  showmessage("ÎÞЧҳÃæ²ÎÊý!");
  //×Ô¶¨ÒåµÄÊä³öÌáʾº¯Êý
 }
 if($type == 1){
  $script = '';
 }else{
  $script = ".htm";
 }
 if($num > $perpage) {
  $page = 6;
  $offset = 2;
  $pages = ceil($num / $perpage);
  if($curr_page > $pages){
   showmessage("Äú²é¿´µÄÒ³Ãæ²»´æÔÚ£¡");
  }
  $from = $curr_page - $offset;
  $to = $curr_page + $page - $offset - 1;
  if($page > $pages) {
   $from = 1; $to = $pages;
  }else{
   if($from < 1) {
    $to = $curr_page + 1 - $from;
    $from = 1;
    if(($to - $from) < $page && ($to - $from) < $pages) {
     $to = $page;
    }
   }elseif($to > $pages) {
    $from = $curr_page - $pages + $to;
    $to = $pages;
    if(($to - $from) < $page && ($to - $from) < $pages) {
     $from = $pages - $page + 1;
    }
&nbs


Ïà¹ØÎĵµ£º

phpÖÐempty()£¬is_null()£¬isset()£¬boolÖ®¼äµÄÇø±ð


´ÓÕâ¸öͼÖУ¬¿ÉÒÔºÜÇå³þµÄ¿´µ½Ò»ÖÖÁªÏµ£º
¼ÙÉè $var ÊÇÈκÎtype¡£
µ± empty($var) Ϊ true ʱ£¬ (bool)($var) Ϊ false ¡£·´Ö®ÒàÈ»¡£
ͬÑù£¬
µ± is_null($var) Ϊ true ʱ£¬ isset($var) Ϊ false ¡£·´Ö®ÒàÈ»¡£
¼ÙÈç:
$i=$j+1;
ÕâÀïµÄis_null($j)Ϊtrue
¿É¼û£º
issetÓÃÓÚÅжÏ䶨ÒåµÄÇé¿ö¡£
Empty¿ÉÒÔÅжÏδ¶¨Ò ......

phpÊÕ¼¯

get_class_methods() // ËùÓз½·¨   
get_included_files()//·µ»Øµ±Ç°Ò³ËùÓмÓÔصÄÎļþ   
get_declared_classes()// ·µ»Øµ±Ç°Ò³ËùÓÐclass   
get_declared_interfaces()// ·µ»ØËùÓеĽӿڠ  
get_defined_functions()// ·µ»ØËùÓеÄfunction &nb ......

³¬Ç¿PHP·ÖÒ³Àà

ʵÀýÓ¦Óãº
1<?
2require_once('../libs/classes/page.class.php');
3$page=new page(array('total'=>1000,'perpage'=>20));
4echo 'mode:1<br>'.$page->show();
5echo '<hr>mode:2<br>'.$page->show(2);
6echo '<hr>mode:3<br>'.$page->show(3);
7echo '&l ......

ÀûÓÃWindows Schedule TaskÔËÐÐphp³ÌÐò

¼Æ»®ÈÎÎñ£¨Schedule Task£©ÊÇwindowsƽ̨ÉϺÍcronÀàËƵÄÒ»¸ö³ÌÐò£¬µ±È»¹¦ÄÜÉϲîÁ˺ܶàÁË¡£
ÒòΪÐèҪÿ¸öСʱÔËÐÐÒ»¸öPHP³ÌÐò£¬ÊÖ¶¯²Ù×÷²»ÏÖʵÁË¡£
Ê×ÏÈÔÚcmdϲâÊÔ£¬ÀýÈ磺 c:\appserv\php5\php.exe "C:\AppServ\www\temp2.php"
ÓÐÒ»µãҪעÒâ¾ÍÊÇÈç¹ûÄǸöPHPÒýÓÃÁËÆäËûÒ³Ã棬ÐèÒªÌṩ¾ø¶Ô·¾¶ÁË£¬ÖÁÉÙÎҵIJâÊÔ ......

PHPѧϰ

phpÊÇÒ»ÖÖ¿ª·ÅÔ´´úÂ롢ǶÈëʽ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ¡£
1¡¢PHPÒ²ÊÇǶÈëʽCGIÓïÑÔ¡£PHP4ÊDZ»·â×°ÔÚ±ê¼ÇÖеÄǶÈëʽÓïÑÔ£¬Äã¿ÉÒÔÇáÒ×µØÔÚPHPºÍHTMLÖ®¼ä½øÐÐת»»£¬¶ø²»±ØʹÓôóÁ¿´úÂëÒÔÊä³öHTML¡£Í¨ÓÃÍø¹Ø½Ó¿Ú(CGI)ÔÊÐíÓû§±àдÄܲúÉúHTMLÒÔ¼°¶¯Ì¬´¦ÀíÍøÒ³Êý¾ÝµÄ¼ÆËã»ú³ÌÐò¡£PHP¿ÉÒÔ±»¹éÀàΪCGI¡£
2¡¢Ó¦ÓÃPHPµÄÈý¸öÁìÓò£º(1)·þÎñÆ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ