正確復(fù)制代碼 代碼如下:$sql = "SELECT `user`.`name` FROM `user` WHERE `id` = '$id' LIMIT 1"; 錯(cuò)誤復(fù)制代碼 代碼如下:$sql = "select name.user from name where id = $id "; 第3章 注釋規(guī)則
注釋名稱 文件頭注釋 注釋示范:PHP 代碼:復(fù)制代碼 代碼如下: /** * All abstract representations of inline tags are in this file * @package phpDocumentor * @subpackage InlineTags * @since separate file since version 1.2 * @version $Id $ */ 備注 1)文件頭注釋需要指明所屬的包和子包; 2)在@version中加上$ID,以方便使用CVS管理文件。
3.2.3 類注釋示例 注釋名稱 類注釋 注釋示范: PHP 代碼:復(fù)制代碼 代碼如下: /** * Use this element to represent an {@}inline tag} like {@}link} * @see parserStringWithInlineTags * @package phpDocumentor * @subpackage InlineTags * @author Greg Beaver [email protected] * @since 1.0rc1 * @version $Revision: 1.21.2.6 $ * @tutorial inlinetags.pkg */
3.2.4 類屬性注釋示例 注釋名稱 類屬性注釋 注釋示范: PHP 代碼:復(fù)制代碼 代碼如下: /** * Element type * * Type is used by many functions to skip the hassle of * * code * if get_class($blah) == 'parserBlah' * /code * always "inlinetag" * @var string */ var $type = 'inlinetag'; 3.2.5 函數(shù)/類方法注釋示例 注釋名稱 函數(shù)/類方法注釋 注釋示范: PHP 代碼:復(fù)制代碼 代碼如下: /** * @return string always '' * calculate the short description of a DocBlock * @see parserStringWithInlineTags::getString() * @see parserStringWithInlineTags::trimmedStrlen() */ function getString() { return ''; } PHP教程