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

Golang实现PHP常用函数

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

PPallord

安装

1.字符串相关包

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

字符串相关函数

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