Summary of Golang's implementation of common PHP functions

藏色散人
Release: 2021-01-20 17:45:47
forward
3665 people have browsed it

The following column will introduce you to Golang’s implementation of PHP common functions from thegolang tutorialcolumn. I hope it will be helpful to friends in need!

Summary of Golang's implementation of common PHP functions

# go-to-php(https://github.com/Echo-Mr-Pengw/go-to-php

Use Golang to encapsulate commonly used functions in PHP. In order to distinguish functions in PHP and Go, the functions encapsulated by go-to-php are all preceded by a capitalP. Except forPallordfunctions. Click github

for the code address to install

1. String related packages

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

2. Array related packages
under development
…….

String related functions

##Plcfirst( lcfirst Pucfirst( ucfirst Pstrtoupper( strtoupper Pstrtolower( strtolower Pucword( ucword ##Ptrim( str Pltrim( str Prtrim( str Pchop( str Pmd5( str Psha1( str ##Pord( str string) int Pallord( str string) interface{} Pchr( ascii int32) string Pecho ( a ... interface{}) Pvar_dump( a ... interface{}) a interface{}) input string , multiplier For more golang related technical articles, please visit the go language
go-to-php package function Corresponding PHP function
Pimplode(gluestring ,piecesinterface{}) string implode
Pjoin(gluestring ,piecesinterface{}) string alias of implode, same as Pimplode
Pexplode(delimiter,strstring ,limitint) []string explode
Pstrlen(strstring) int strlen
Pmb_strlen(strstring) int mb_strlen
strstring) string
strstring) string
strstring) string
strstring) string
strstring) string
,character_maskstring) stringtrim
,character_maskstring) stringltrim
,character_maskstring) stringrtrim
,character_maskstring) stringalias of rtrim, the same as Prtrim
string) stringmd5
string) stringsha1
ord
Convert all Character, upgraded version of ord
chr
echo
var_dump ##Pprint(
print Pstr_repeat(
int) stringstr_repeat


column!

The above is the detailed content of Summary of Golang's implementation of common PHP functions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:learnku.com
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 Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!