Home  >  Article  >  Backend Development  >  问问大伙儿函数命名规则

问问大伙儿函数命名规则

WBOY
WBOYOriginal
2016-06-13 11:15:25946browse

问问大家函数命名规则?

本帖最后由 xjl756425616 于 2013-02-25 20:33:07 编辑 function  setDate1(){

}
function setDate2(){

}

碰到这种函数功能类似,处理过程不同的应该怎么做?

合并 or 函数命名规范?

------解决方案--------------------
function setDate(){
    switch (func_num_args()){
case 1:setDate1();break;
case 2:setDate2();break;
    ......
}
}
function  setDate1(){

}
function setDate2(){

}
Statement:
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