https://github.com/hezhizheng/pgo
使用golang实现一些常用的函数(包括但不限于php),持续更新中...
https://github.com/hezhizheng/pgo
go-functions php-functions php2go
Last synced: 6 months ago
JSON representation
使用golang实现一些常用的函数(包括但不限于php),持续更新中...
- Host: GitHub
- URL: https://github.com/hezhizheng/pgo
- Owner: hezhizheng
- License: mit
- Created: 2021-04-29T03:45:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T08:52:07.000Z (about 4 years ago)
- Last Synced: 2025-02-01T18:26:16.840Z (8 months ago)
- Topics: go-functions, php-functions, php2go
- Language: Go
- Homepage: https://pkg.go.dev/github.com/hezhizheng/pgo
- Size: 17.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pgo 使用golang实现一些常用的函数(包括但不限于php一些常用的内置函数)
收集一些常用的操作函数(包括但不限于php一些常用的内置函数),帮助更快的完成开发工作,并减少重复代码,
主要来源于 [https://www.php2golang.com](https://www.php2golang.com/) (每个函数都增加了简单的单元测试)## 安装
`go get -u github.com/hezhizheng/pgo`## 使用
```go
pgo.InArray("hello",[]string{"hello","world"}) // true
pgo.ArrayColumn()
pgo.ArrayPush()
pgo.ArrayPop()
pgo.ArrayUnshift()
pgo.ArrayShift()
pgo.ArrayUnique()
pgo.ArraySearch()pgo.Md5("123465") // e10adc3949ba59abbe56e057f20f883e
pgo.Uniqid("") // 608a594ee0624
pgo.MbStrlen("中文 1") // 4
pgo.Explode(",","hello,world")
pgo.Strpos("+1s","s") // 2
// 将字符串以指定长度进行截断
pgo.StrLimit("测试2q文字超出,符号补充 1a",10,"...") // 测试2q文字超出,符...pgo.Blank(0) // false
pgo.IsNumeric("000") // truepgo.FileExists("path") // bool
// 用法可参考test , 更多函数完善中...
```## License
[MIT](./LICENSE.txt)