Code Monkey home page Code Monkey logo

go-to-php's Introduction

go-to-php

用Golang封装PHP常用的函数,为了区分PHP与Go中的函数,go-to-php封装的函数,都是在对应的PHP函数的前面加上大写的PPallord函数除外

安装

  1. 字符串相关包

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

  1. 变量相关处理包

go get -u github.com/Echo-Mr-Pengw/go-to-php/variable

  1. 打印输出相关包

go get -u github.com/Echo-Mr-Pengw/go-to-php/output

  1. 数组相关包

go get -u github.com/Echo-Mr-Pengw/go-to-php/array

  1. 其它包

开发中....

字符串相关函数

go-to-php封装函数 对应的PHP函数
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{} 转化全部字符,ord的升级版
Pchr(ascii int32) string chr
Pstr_repeat(input string , multiplier int) string str_repeat

变量处理相关函数

go-to-php封装函数 对应的PHP函数
Pgettype(variable interface{}) string gettype
Pis_array(variable interface{}) bool is_array
Pis_bool(variable interface{}) bool is_bool
Pis_double(variable interface{}) bool is_double
Pis_float(variable interface{}) bool is_float
Pis_int(variable interface{}) bool is_int
Pis_integer(variable interface{}) bool is_integer
Pis_long(variable interface{}) bool is_long
Pis_string(variable interface{}) bool is_string
Pis_numeric(variable interface{}) bool is_numeric

变量处理相关函数

go-to-php封装函数 对应的PHP函数
Pecho(a ...interface{}) echo
Pvar_dump(a ...interface{}) var_dump
Pprint(a interface{}) print

数组相关函数

go-to-php封装函数 对应的PHP函数
Parray_change_key_case(m map[string]interface{}) (map[string]interface{}) array_change_key_case

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.