xuzuning(唠叨)很笨,看不出他们有什么不同的地方

解决方案 »

  1.   

    我喜欢这样:)/*
     ********************************************************************
     *  Editor           :  EditPlus+ 2.11                              *
     ******************************************************************** +------------------------------------------------------------------+
     |  PHP Version 4                                                   |
     +------------------------------------------------------------------+
     |  Copyright (C) 2004-2005 All Right Reseved Pc Rookie's           |
     +------------------------------------------------------------------+
     |  Notices:                                                        |
     |  If you found any error in the source code. Then I'll hope you s-|
     |end Bug email to us. So we'll thank you very much.                |
     |                                                                  |
     |                                                                  |
     |                                                                  |
     +------------------------------------------------------------------+
     |  Author          :   Pc Rookie's                                 |
     |  Contact Email   :   [email protected]                            |
     |  LastModify      :   2004/17/12                                  |
     |  Update Times    :   1 Times                                     |
     +------------------------------------------------------------------+ +------------------------------------------------------------------+
     |  FileName        :   DB.php                                      |
     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     |  Function        :   Database independent query interface        |
     +------------------------------------------------------------------+
     |  Useage example:                                                 |
     |                                                                  |
     |  Step 1: Must Be Define subclass                                 |
     |  class UseAge extends DB                                         |
     |  {                                                               |
     |      //Declare your MySQL Server Parameter                       |
     |      var $Host     = "127.0.0.1"; #Host                          |
     |      var $User     = "mysql";     #User                          |
     |      var $Password = "";          #Password                      |
     |                                                                  |
     |      var $Debug    = 0;           #No Display Debug Information  |
     |   }                                                              |
     |                                                                  |
     |  Step2: Must Be Instantiation class                              |
     |  $exp = new UseAge;                                              |
     |                                                                  |
     |  Step3: Call class method                                        |
     |  $sql = "...";                                                   |
     |  $exp -> query($sql);                                            |
     |  $result = $exp -> rs();                                         |
     |                                                                  |
     +------------------------------------------------------------------+
    Example:include("DB.inc");
    class soft extends DB                                         
    {                                                               
         //Declare your MySQL Server Parameter                       
         var $Host     = "127.0.0.1"; #Host
     var $Database = "www";       #Database
         var $User     = "mysql";     #User                          
         var $Password = "";          #Password                           var $Debug    = 0;           #No Display Debug Information  
    }    $db = new soft;//截取指定字符串长度(不会将汉字截开)!
    function fixlenstr($str,$len)
    {
    $str = (string)$str;
    $len = (int)$len;
    $strlen = strlen($str);
    if($len>$strlen) $len = $strlen;
    $i = 0;
    $fixlen = 0;
    while($i<$len)
    {
    $chr = $str[$i];
    $i++;
    if(ord($chr)<0x80) $fixlen++;
    elseif($i<$len)
    {
    $i++;
    $fixlen += 2;
    }
    }return $len>=$strlen ? substr($str,0,$fixlen) : substr($str,0,$fixlen)."...";
    }
    //首页分类最新更新10条
    function getNewUpdate10($scid)
    {
    global $db;
        $sql = "SELECT ID, Name FROM down_final_class,down_info WHERE down_final_class.SCID=$scid AND down_info.FCID=down_final_class.FCID ORDER BY ID DESC";$db -> query($sql);    if($db->queryRow)
    {
    $db -> query($sql);
    $page_size = 10;
    $page = 1;list($total_rec, $page_size, $page, $total_page, $page_start, $page_end) = $db -> splitPage($page_size, $page);for($i = $page_start; $i < $page_end; $i++)
    {
    $rs = $db -> rs($i);print("<li><a href=\"detail.php?id=$rs[ID]\" title=\"$rs[Name]\">".fixlenstr($rs[Name],27)."</a></li>");
    }if($db -> queryRow >= $page_size)
    print("<li class=\"more\"><a href=\"list.php?scid=$scid\">更多...</a></li>");
    }
    else
    {
    print("<li>目前该类尚无任何资源!</li>");
    }
    }*/
      

  2.   

    2是phpdoc注释,可以从注释生成文档
      

  3.   

    要知道他们为什么要用这些格式来进行注释,因为一些工具可以对其认识的格式将代码和注释转换成文档,如phpdoc
      

  4.   

    喜欢用第二种,也就是/*
     @author Philipp v. Criegern [email protected]
     @version 1.0.2 02.04.2003
    */
      

  5.   

    以下这种比较好:/*
    注释
    注释
    //*/这种注释方式尤其是在注释掉某些Code的时候很好用,注释掉之后,又想重新使用,则只需要在最前面增加一个"/",就可以用了,很方便的。
      

  6.   

    /*******************************************
    *      程序制作:贵州扬升科技有限公司       *
    *           http://www.gzuu.com            *
    *           http://www.gzuu.net            *
    *           http://www.gzuu.cn             *
    *******************************************/
      

  7.   

    /**
     * 我一般是这种
     * 
     * @access 
     */