首頁  >  文章  >  後端開發  >  總結Golang實作PHP常用函數

總結Golang實作PHP常用函數

藏色散人
藏色散人轉載
2021-01-20 17:44:333690瀏覽
##上中對

golang教學專欄上提供給大家說明Golang#PHP常用函數,並希望於對需要的朋友有所幫助!

總結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(implodePjoin(implode的別名,同PimplodePexplode(explodePstrlen(strlenPmb_strlen(mb_strlenPlcfirst(# Pucfirst(strPstrtoupper(strPstrtolower(str##Pucword(str string) stringPtrim(str , Pltrim(str , #Prtrim(str , Pchop(str , Pmd5(str string) stringPsha1(str string) stringPord(str string) intPallord(str string) interface{}Pchr(ascii int32) stringPecho (a ...interface{})#Pvar_dump(a ...interface{}) Pprint(a interface{})# Pstr_repeat(input string , #更多golang相關技術文章,請造訪
glue string , pieces interface{})  string
glue string , pieces interface{})  string
delimiter , str string , limit int) []string
str string) int
# string) int
str string) string##lcfirst
string) stringucfirst
string) string#strtoupper
string) stringstrtolower
ucword
character_mask string) string# trim
character_mask string) stringltrim
character_mask string) stringrtrim
character_mask string) stringrtrim的別名,同Prtrim
md5
sha1
ord
#轉換全部字符,ord的升級版
chr
echo
var_dump
print
multiplier int) stringstr_repeat


go語言

欄位!

以上是總結Golang實作PHP常用函數的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:learnku.com。如有侵權,請聯絡admin@php.cn刪除