加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PHP命名约定?

发布时间:2020-12-13 13:22:27 所属栏目:PHP教程 来源:网络整理
导读:我现在正在编码smt,并且我有点担心 PHP有时用下划线调用它的函数,有时候用一个单词.那是怎么回事? 例: int strlen(string $str) 和 bool in_array ( mixed $needle,array $haystack [,bool $strict = FALSE ] ) 我希望有一个很好的理由,并且真的想知道它是
我现在正在编码smt,并且我有点担心 PHP有时用下划线调用它的函数,有时候用一个单词.那是怎么回事?

例:

int strlen(string $str)

bool in_array ( mixed $needle,array $haystack [,bool $strict = FALSE ] )

我希望有一个很好的理由,并且真的想知道它是什么.

引用自: http://tnx.nl/php.html

PHP has inconsistent function naming
There is no apparent system in underscore(s) versus no underscore(s):

underscore               no underscore:

stream_get_line          readline
disk_free_space          diskfreespace
is_object                isset
mcal_day_of_week         jddayofweek
set_error_handler        setlocale
snmp_get_quick_print     snmpget
get_browser              getallheaders
base64_encode            urlencode
image_type_to_mime_type  imagetypes
msql_num_fields          mysql_numfields
php_uname                phpversion
strip_tags               stripslashes
bind_textdomain_codeset  bindtextdomain
cal_to_jd                gregoriantojd
str_rot13                strpos

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读