资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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常用函数有哪些
网页URL:http://cdkjz.cn/article/jpjopi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220