你知道Golang怎么封装PHP常用函数吗!

你知道Golang怎么封装PHP常用函数吗!,第1张

你知道Golang怎么封装PHP常用函数吗! 本文由golang教程栏目给大家介绍关于Golang怎么实现PHP常用函数,希望对需要的朋友有所帮助!

go-to-php

用Golang封装PHP常用的函数,为了区分PHP与Go中的函数,go-to-php封装的函数,都是在对应的PHP函数的前面加上大写的PPallord函数除外。相关代码点击github(https://github.com/Echo-Mr-Pengw/go-to-php)

安装
  • 字符串相关包

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

以上就是你知道Golang怎么封装PHP常用函数吗!的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/682338.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-20
下一篇 2022-04-20

发表评论

登录后才能评论

评论列表(0条)

保存