新聞中心
本文由
golang教程欄目給大家介紹關(guān)于Golang怎么實(shí)現(xiàn)php常用函數(shù),希望對(duì)需要的朋友有所幫助!

創(chuàng)新互聯(lián)公司,專注為中小企業(yè)提供官網(wǎng)建設(shè)、營(yíng)銷型網(wǎng)站制作、響應(yīng)式網(wǎng)站設(shè)計(jì)、展示型網(wǎng)站設(shè)計(jì)、網(wǎng)站制作等服務(wù),幫助中小企業(yè)通過網(wǎng)站體現(xiàn)價(jià)值、有效益。幫助企業(yè)快速建站、解決網(wǎng)站建設(shè)與網(wǎng)站營(yíng)銷推廣問題。
go-to-php
用Golang封裝PHP常用的函數(shù),為了區(qū)分PHP與Go中的函數(shù),go-to-php封裝的函數(shù),都是在對(duì)應(yīng)的PHP函數(shù)的前面加上大寫的P。Pallord函數(shù)除外。相關(guān)代碼點(diǎn)擊github(https://github.com/echo-Mr-Pengw/go-to-php)
安裝
-
字符串相關(guān)包
go get -u github.com/Echo-Mr-Pengw/go-to-php/str
-
數(shù)組相關(guān)包
開發(fā)中
字符串相關(guān)函數(shù)
| go-to-php封裝函數(shù) | 對(duì)應(yīng)的PHP函數(shù) |
|---|---|
Pimplode(glue string , pieces interface{}) string |
implode |
Pjoin(glue string , pieces interface{}) string |
implode的別名,同Pimplode |
Pexplode(delimiter , str string , limit int) []string |
explode |
Pstrlen(str string) int |
strlen |
Pmb_strlen(str string) int |
mb_strlen |
Plcfirst(str string) string |
lcfirst |
Pucfirst(str string) string |
ucfirst |
Pstrtoupper(str string) string |
strtoupper |
Pstrtolower(str string) string |
strtolower |
Pucword(str string) string |
ucword |
Ptrim(str , character_mask string) string |
trim |
Pltrim(str , character_mask string) string |
ltrim |
Prtrim(str , character_mask string) string |
rtrim |
Pchop(str , character_mask string) string |
rtrim的別名,同Prtrim |
Pmd5(str string) string |
md5 |
Psha1(str string) string |
sha1 |
Pord(str string) int |
ord |
Pallord(str string) interface{} |
轉(zhuǎn)化全部字符,ord的升級(jí)版 |
Pchr(ascii int32) string |
chr |
Pecho(a ...interface{}) |
echo |
Pvar_dump(a ...interface{}) |
var_dump |
Pprint(a interface{}) |
|
Pstr_repeat(input string , multiplier int) string |
str_repeat |
網(wǎng)站欄目:你知道Golang怎么封裝PHP常用函數(shù)嗎!
本文URL:http://www.dlmjj.cn/article/dhpgcdh.html


咨詢
建站咨詢
