总结Golang实现PHP常用函数

总结Golang实现PHP常用函数,第1张

总结Golang实现PHP常用函数

下面由golang教程栏目给大家介绍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{}) stringimplodePjoin(glue string , pieces interface{}) stringimplode的别名,同PimplodePexplode(delimiter , str string , limit int) []stringexplodePstrlen(str string) intstrlenPmb_strlen(str string) intmb_strlenPlcfirst(str string) stringlcfirstPucfirst(str string) stringucfirstPstrtoupper(str string) stringstrtoupperPstrtolower(str string) stringstrtolowerPucword(str string) stringucwordPtrim(str , character_mask string) stringtrimPltrim(str , character_mask string) stringltrimPrtrim(str , character_mask string) stringrtrimPchop(str , character_mask string) stringrtrim的别名,同PrtrimPmd5(str string) stringmd5Psha1(str string) stringsha1Pord(str string) intordPallord(str string) interface{}转化全部字符,ord的升级版Pchr(ascii int32) stringchrPecho(a ...interface{})echoPvar_dump(a ...interface{})var_dumpPprint(a interface{})printPstr_repeat(input string , multiplier int) stringstr_repeat

更多golang相关技术文章,请访问go语言栏目!

以上就是总结Golang实现PHP常用函数的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/683652.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-20
下一篇 2022-04-20

发表评论

登录后才能评论

评论列表(0条)

保存