1.2.3.4.大家喜欢哪种注释风格? xuzuning(唠叨)很笨,看不出他们有什么不同的地方 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我喜欢这样:)/* ******************************************************************** * 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是phpdoc注释,可以从注释生成文档 要知道他们为什么要用这些格式来进行注释,因为一些工具可以对其认识的格式将代码和注释转换成文档,如phpdoc 喜欢用第二种,也就是/* @author Philipp v. Criegern [email protected] @version 1.0.2 02.04.2003*/ 以下这种比较好:/*注释注释//*/这种注释方式尤其是在注释掉某些Code的时候很好用,注释掉之后,又想重新使用,则只需要在最前面增加一个"/",就可以用了,很方便的。 /******************************************** 程序制作:贵州扬升科技有限公司 ** http://www.gzuu.com ** http://www.gzuu.net ** http://www.gzuu.cn ********************************************/ /** * 我一般是这种 * * @access */ 您的 PHP 似乎没有安装运行 WordPress 所必需的 MySQL 扩展。 关于文本框获得焦点问题 求助:Google +1 按钮优化 求助,菜鸟的一个小小疑问 采集后的数理 接收ajax传送到服务器的xml的一个问题. 怎么动态增加删除表单框? 我的分页那里错了?mysql_fetch_array(): supplied argument is not a valid MySQL result resource i php连接oracle有几种方法呢? php 为什么有那么多进程?一个不够吗? 两个PHP通用分页函数 请问一个论坛登录问题
********************************************************************
* 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>");
}
}*/
@author Philipp v. Criegern [email protected]
@version 1.0.2 02.04.2003
*/
注释
注释
//*/这种注释方式尤其是在注释掉某些Code的时候很好用,注释掉之后,又想重新使用,则只需要在最前面增加一个"/",就可以用了,很方便的。
* 程序制作:贵州扬升科技有限公司 *
* http://www.gzuu.com *
* http://www.gzuu.net *
* http://www.gzuu.cn *
*******************************************/
* 我一般是这种
*
* @access
*/