go-to-php
Use Golang to encapsulate common functions in PHP, in order to distinguish PHP from Go The functions in and the functions encapsulated by go-to-php are all preceded by an uppercase P
in front of the corresponding PHP function. Except for Pallord
functions. For related code, click github (https://github.com/Echo-Mr-Pengw/go-to-php)
Installation
String related packages
go get -u github.com/Echo-Mr-Pengw/go-to-php/str
array Related packages
under development
......
String related functions
go-to-php encapsulation function | Corresponding PHP function |
---|---|
Pimplode( glue string , pieces interface{}) string |
implode |
Pjoin(glue string , pieces interface{}) string |
alias of implode, same as Pimplode |
Pexplode(delimiter , str string , limit int) []string |
explode |
str string) int
| strlen|
str string) int
| mb_strlen|
str string) string
| lcfirst|
str string) string
| ucfirst|
str string) string
| strtoupper|
str string) string
| strtolower|
str string) string
| ucword|
str , character_mask string) string
| trim|
str , character_mask string) string
| ltrim|
str , character_mask string) string
| rtrim|
str , character_mask string) string
| An alias for rtrim, the same as Prtrim |
str string) string
| md5|
str string) string
| sha1|
str string) int
| ord|
str string) interface{}
| Convert all characters, an upgraded version of ord|
ascii int32) string
| chr|
a ...interface{})
| echo|
a ...interface{})
| var_dump|
a interface{})
| print|
input string , multiplier int) string
| str_repeat