PHP程序写大量诠释好吗

WBOY
Release: 2016-06-13 11:28:38
Original
935 people have browsed it

PHP程序写大量注释好吗?
我写php代码有大量注释,会不会有什么对php运行性能有不好的影响啊?
注释多的很,有时间比代码本身还多。有没有什么弊端?


如:

//这个是投票的核心功能区,只要该用户今天没有投票就可以投票
//投票成功:1.本投票表对应行记录增加一票 2.投票记录表增加该用户的投票记录,防止他今天再投。

$voteid=$_GET["voteid"];

//拿到id了,但是我们不是直接就给这个id添加一票。我们要先看看,这个ip今天是否已经投过票了。

//有了ip黑名单功能,我们应该在最先核实该用户是否已经进入我们的黑名单了,如果进了黑名单,后面的所有都不用走了。





//我们先拿到这个朋友的ip。
$nowip=$_SERVER["REMOTE_ADDR"];
$today=date("Ymd");


//然后去我们ip记录表查询今天这个ip是否有记录
$where="ip='$nowip' and votedate='$today'";

//下面我们查询记录表,看看有没有相关记录
$record=new Record();
$res=$record->fetchAll($where)->toArray();
if(count($res) > 10){
$this->view->res="您今天已经投过票了";
$this->render("res");
}else{

//如果进到这里,说明这个ip是可以投票的,我们先增加他的ip信息,再增加一个票数

$recordarr=array(
"ip"=>$nowip,
"votedate"=>$today,
"voteid"=>$voteid
);


//增加一条记录,如果添加成功返回添加成功的id值
$insertres=$record->insert($recordarr);
if($insertres){
//如果进来,说明添加记录成功,那么我们就直接增加该用户投的对应的一票,下面我们又要操作vote表
$vote=new Vote();
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!