总结Golang实现PHP常用函数


本文摘自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{}) 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相关技术文章,请访问go语言栏目!

以上就是总结Golang实现PHP常用函数的详细内容,更多文章请关注木庄网络博客!!

相关阅读 >>

Golang并发编程是什么

chaos-mesh on mips64

Golang 的内存管理(上篇)

Golang实现二叉树路径遍历

聊聊dubbo-Go-proxy的plugins

手撸Golang 仿spring ioc/aop 之6 扫码1

聊聊dubbo-Go-proxy的apifilter

[系列] Go - 统一定义 api 错误码

Golang基础数据类型字符串

Golang 包怎么调用

更多相关阅读请进入《Go》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...