教程集 www.jiaochengji.com
教程集 >  Golang编程  >  golang教程  >  正文 Golang实现PHP常用函数

Golang实现PHP常用函数

发布时间:2022-03-03   编辑:jiaochengji.com
教程集为您提供Golang实现PHP常用函数等资源,欢迎您收藏本站,我们将为您提供最新的Golang实现PHP常用函数资源
<h1>go-to-php</h1>

用Golang封装PHP常用的函数,为了区分PHP与Go中的函数,go-to-php封装的函数,都是在对应的PHP函数的前面加上大写的<code>P</code>。<code>Pallord</code>函数除外。相关代码点击github

<h4>安装</h4><ol><li>字符串相关包</li></ol>

<code>go get -u github.com/Echo-Mr-Pengw/go-to-php/str</code>

<ol><li>数组相关包</li></ol>

<code>开发中</code>

.......

<h4>字符串相关函数</h4><table><thead><tr><th>go-to-php封装函数</th><th>对应的PHP函数</th></tr></thead><tbody><tr><td>Pimplode(<code>glue</code> string , <code>pieces</code> interface{}) string</td><td>implode</td></tr><tr><td>Pjoin(<code>glue</code> string , <code>pieces</code> interface{}) string</td><td>implode的别名,同Pimplode</td></tr><tr><td>Pexplode(<code>delimiter</code> , <code>str</code> string , <code>limit</code> int) []string</td><td>explode</td></tr><tr><td>Pstrlen(<code>str</code> string) int</td><td>strlen</td></tr><tr><td>Pmb_strlen(<code>str</code> string) int</td><td>mb_strlen</td></tr><tr><td>Plcfirst(<code>str</code> string) string</td><td>lcfirst</td></tr><tr><td>Pucfirst(<code>str</code> string) string</td><td>ucfirst</td></tr><tr><td>Pstrtoupper(<code>str</code> string) string</td><td>strtoupper</td></tr><tr><td>Pstrtolower(<code>str</code> string) string</td><td>strtolower</td></tr><tr><td>Pucword(<code>str</code> string) string</td><td>ucword</td></tr><tr><td>Ptrim(<code>str</code> , <code>character_mask</code> string) string</td><td>trim</td></tr><tr><td>Pltrim(<code>str</code> , <code>character_mask</code> string) string</td><td>ltrim</td></tr><tr><td>Prtrim(<code>str</code> , <code>character_mask</code> string) string</td><td>rtrim</td></tr><tr><td>Pchop(<code>str</code> , <code>character_mask</code> string) string</td><td>rtrim的别名,同Prtrim</td></tr><tr><td>Pmd5(<code>str</code> string) string</td><td>md5</td></tr><tr><td>Psha1(<code>str</code> string) string</td><td>sha1</td></tr><tr><td>Pord(<code>str</code> string) int</td><td>ord</td></tr><tr><td>Pallord(<code>str</code> string) interface{}</td><td>转化全部字符,ord的升级版</td></tr><tr><td>Pchr(<code>ascii</code> int32) string</td><td>chr</td></tr><tr><td>Pecho(<code>a ...</code>interface{})</td><td>echo</td></tr><tr><td>Pvar_dump(<code>a ...</code>interface{})</td><td>var_dump</td></tr><tr><td>Pprint(<code>a</code> interface{})</td><td>print</td></tr><tr><td>Pstr_repeat(<code>input</code> string , <code>multiplier</code> int) string</td><td>str_repeat</td></tr><tr><td> </td><td> </td></tr></tbody></table>
到此这篇关于“Golang实现PHP常用函数”的文章就介绍到这了,更多文章或继续浏览下面的相关文章,希望大家以后多多支持JQ教程网!

您可能感兴趣的文章:
学习golang开始前的准备工作
探索Golang协程实现——从v1.0开始
golang 动态生成函数_GoLang的优点和缺点
Golang - 访问数据库报错后程序继续运行
关于Golang的那些事(五) -- 函数
golang匿名函数和闭包学习笔记
Golang实现PHP常用函数
golang sleep函数 休眠延时
衡量Golang代码执行时间
GoLang的匿名函数与闭包

[关闭]
~ ~