Home > Backend Development > Golang > Do you know how Golang encapsulates common PHP functions?

Do you know how Golang encapsulates common PHP functions?

藏色散人
Release: 2022-01-21 16:02:05
forward
3021 people have browsed it

This article is provided by the golang tutorial column to introduce to you how to implement common PHP functions in Golang. I hope it will be helpful to friends in need!

go-to-php

Use Golang to encapsulate common functions in PHP, in order to distinguish PHP from Go The functions in and the functions encapsulated by go-to-php are all preceded by an uppercase P in front of the corresponding PHP function. Except for Pallord functions. For related code, click github (https://github.com/Echo-Mr-Pengw/go-to-php)

Installation

  • String related packages

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

  • array Related packages

under development

......

String related functions

##Pstrlen(strlenPmb_strlen(mb_strlenPlcfirst(lcfirstPucfirst(ucfirstPstrtoupper(strtoupperPstrtolower(strtolowerPucword(ucwordPtrim(trimPltrim(ltrimPrtrim(rtrimPchop(An alias for rtrim, the same as Prtrim Pmd5(md5Psha1(sha1Pord(ordPallord(Convert all characters, an upgraded version of ordPchr(chrPecho(echoPvar_dump(var_dumpPprint(printPstr_repeat(str_repeat
go-to-php encapsulation function Corresponding PHP function
Pimplode( glue string , pieces interface{}) string implode
Pjoin(glue string , pieces interface{}) string alias of implode, same as Pimplode
Pexplode(delimiter, str string , limit int) []string explode
str string) int
str string) int
str string) string
str string) string
str string) string
str string) string
str string) string
str , character_mask string) string
str , character_mask string) string
str , character_mask string) string
str , character_mask string) string
str string) string
str string) string
str string) int
str string) interface{}
ascii int32) string
a ...interface{})
a ...interface{})
a interface{})
input string , multiplier int) string

The above is the detailed content of Do you know how Golang encapsulates common PHP functions?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
How to choose golang web mvc framework
From 1970-01-01 08:00:00
0
0
0
Is it necessary to use nginx when using golang?
From 1970-01-01 08:00:00
0
0
0
golang - vim plug-in to write go
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template