PHP开发编码规范

浏览52281
更新时间2022-04-15

前言

PHP程序头注释块

每个程序头部必须有统一的注释块,规则如下:
a. 必须包含本程序的描述;
b. 必须包含作者;
c. 必须包含书写日期;
d. 必须包含版本信息;
e. 必须包含项目名称;
f. 必须包含文件的名称;
g. 重要的使用说明,如类的调用方法、注意事项等;
参考例子如下:

<?php
//
// +---------------------------------------------------------+
// | PHP version 4.0                                         |
// +---------------------------------------------------------+
// | Copyright (c) 1997-2001 The PHP Group                   |
// +---------------------------------------------------------+
// | This source file is subject to  of the PHP license,     |
// | that is bundled with this packafile LICENSE, and is     |
// | available at through the world-web at                   |
// | http://www.php.net/license/2_02.txt.                    |
// | If you did not receive a copy of the  and are unable to |
// | obtain it through the world-wide-web,end a note to      |
// | license@php.net so we can mail you a immediately.       |
// +---------------------------------------------------------+
// | Authors: Stig Bakken <ssb@fast.no>                      |
// |          Tomas V.V.Cox <cox@idecnet.com>                |
// |                                                         |
// +---------------------------------------------------------+
//
// $Id: Common.php,v 1.8.2.3 2001/11/13 01:26:48 ssb Exp $

相关视频

更多

免费

php8,我来也
初级php8,我来也

321865次学习

收藏

免费

Thinkphp6.0正式版视频教程
中级Thinkphp6.0正式版视频教程

382481次学习

收藏

免费

细说PHP第一季
中级细说PHP第一季

282922次学习

收藏

免费

简单聊聊PHP创业那点事
初级简单聊聊PHP创业那点事

13419次学习

收藏

精品课程

更多
前端入门_HTML5
前端入门_HTML5

共29课时 | 62.5万人学习

CSS视频教程-玉女心经版
CSS视频教程-玉女心经版

共25课时 | 39.8万人学习

JavaScript极速入门_玉女心经系列
JavaScript极速入门_玉女心经系列

共43课时 | 73.8万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号