GithubHelp home page GithubHelp logo

hezhizheng / pgo Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 18 KB

使用golang实现一些常用的函数(包括但不限于php),持续更新中...

Home Page: https://pkg.go.dev/github.com/hezhizheng/pgo

License: MIT License

Go 100.00%
php2go go-functions php-functions

pgo's Introduction

pgo 使用golang实现一些常用的函数(包括但不限于php一些常用的内置函数)

收集一些常用的操作函数(包括但不限于php一些常用的内置函数),帮助更快的完成开发工作,并减少重复代码, 主要来源于 https://www.php2golang.com (每个函数都增加了简单的单元测试)

安装

go get -u github.com/hezhizheng/pgo

使用

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") // true

pgo.FileExists("path") // bool
// 用法可参考test , 更多函数完善中...

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.