新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Golang实现PHP常用函数有哪些

小编给大家分享一下Golang实现PHP常用函数有哪些,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

创新互联长期为1000多家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为察哈尔右翼前企业提供专业的网站建设、成都网站制作察哈尔右翼前网站改版等技术服务。拥有十余年丰富建站经验和众多成功案例,为您定制开发。

Golang实现PHP常用函数

# go-to-php(https://github.com/Echo-Mr-Pengw/go-to-php)

用Golang封装PHP常用的函数,为了区分PHP与Go中的函数,go-to-php封装的函数,都是在对应的PHP函数的前面加上大写的PPallord函数除外。代码地址点击github

安装

1.字符串相关包

go get -u github.com/Echo-Mr-Pengw/go-to-php/str

2.数组相关包
开发中
…….

字符串相关函数

go-to-php封装函数对应的PHP函数
Pimplode(glue string , pieces interface{})  stringimplode
Pjoin(glue string , pieces interface{})  stringimplode的别名,同Pimplode
Pexplode(delimiter , str string , limit int) []stringexplode
Pstrlen(str string) intstrlen
Pmb_strlen(str string) intmb_strlen
Plcfirst(str string) stringlcfirst
Pucfirst(str string) stringucfirst
Pstrtoupper(str string) stringstrtoupper
Pstrtolower(str string) stringstrtolower
Pucword(str string) stringucword
Ptrim(str , character_mask string) stringtrim
Pltrim(str , character_mask string) stringltrim
Prtrim(str , character_mask string) stringrtrim
Pchop(str , character_mask string) stringrtrim的别名,同Prtrim
Pmd5(str string) stringmd5
Psha1(str string) stringsha1
Pord(str string) intord
Pallord(str string) interface{}转化全部字符,ord的升级版
Pchr(ascii int32) stringchr
Pecho(a ...interface{})echo
Pvar_dump(a ...interface{})var_dump
Pprint(a interface{})print
Pstr_repeat(input string , multiplier int) stringstr_repeat


看完了这篇文章,相信你对“Golang实现PHP常用函数有哪些”有了一定的了解,如果想了解更多相关知识,欢迎关注创新互联行业资讯频道,感谢各位的阅读!


分享标题:Golang实现PHP常用函数有哪些
浏览地址:http://www.wjwzjz.com/article/jpjopi.html
在线咨询
服务热线
服务热线:028-86922220
TOP