Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syyongx/php2go
Use Golang to implement PHP's common built-in functions.
https://github.com/syyongx/php2go
go php
Last synced: about 19 hours ago
JSON representation
Use Golang to implement PHP's common built-in functions.
- Host: GitHub
- URL: https://github.com/syyongx/php2go
- Owner: syyongx
- License: mit
- Created: 2018-04-05T04:02:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-09T09:05:58.000Z (2 months ago)
- Last Synced: 2024-11-27T13:08:28.423Z (15 days ago)
- Topics: go, php
- Language: Go
- Homepage:
- Size: 116 KB
- Stars: 1,635
- Watchers: 43
- Forks: 311
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - php2go - 140+ PHP function packs implemented in Go (Open source library / Development Aid Package)
- awesome-list - php2go - in functions. | syyongx | 1265 | (Go)
- awesome-golang-repositories - php2go - in functions. (Repositories)
- favorite-link - 使用 Golang 实现 PHP 的常见内置函数。
README
# PHP2Go
[![GoDoc](https://godoc.org/github.com/syyongx/php2go?status.svg)](https://godoc.org/github.com/syyongx/php2go)
[![Go Report Card](https://goreportcard.com/badge/github.com/syyongx/php2go)](https://goreportcard.com/report/github.com/syyongx/php2go)
[![MIT licensed][3]][4][3]: https://img.shields.io/badge/license-MIT-blue.svg
[4]: LICENSEUse Golang to implement PHP's common built-in functions. About 140+ functions have been implemented.
## Install
```shell
go get github.com/syyongx/php2go
```## Requirements
Go 1.10 or above.## PHP Functions
### Date/Time Functions
```php
time()
strtotime()
date()
checkdate()
sleep()
usleep()
```### String Functions
```php
strpos()
stripos()
strrpos()
strripos()
str_replace()
ucfirst()
lcfirst()
ucwords()
substr()
strrev()
number_format()
chunk_split()
str_word_count()
wordwrap()
strlen()
str_repeat()
strstr()
strtr()
str_shuffle()
trim()
ltrim()
rtrim()
explode()
strtoupper()
strtolower()
chr()
ord()
nl2br()
json_encode()
json_decode()
addslashes()
stripslashes()
quotemeta()
htmlentities()
html_entity_decode()
md5()
md5_file()
sha1()
sha1_file()
crc32()
levenshtein()
similar_text()
soundex()
parse_str()
```### Multibyte String Functions
```php
mb_strlen()
mb_strtoupper()
```### URL Functions
```php
base64_encode()
base64_decode()
parse_url()
urlencode()
urldecode()
rawurlencode()
rawurldecode()
http_build_query()
```### Array(Slice/Map) Functions
```php
array_fill()
array_flip()
array_keys()
array_values()
array_merge()
array_chunk()
array_pad()
array_slice()
array_rand()
array_column()
array_push()
array_pop()
array_unshift()
array_shift()
array_key_exists()
array_combine()
array_reverse()
implode()
in_array()
```### Mathematical Functions
```php
abs()
rand()
round()
floor()
ceil()
pi()
max()
min()
decbin()
bindec()
hex2bin()
bin2hex()
dechex()
hexdec()
decoct()
Octdec()
base_convert()
is_nan()
```### CSPRNG Functions
```php
random_bytes()
random_int()
```### Directory/Filesystem Functions
```php
stat()
pathinfo()
file_exists()
is_file()
is_dir()
filesize()
file_put_contents()
file_get_contents()
unlink()
delete()
copy()
is_readable()
is_writeable()
rename()
touch()
mkdir()
getcwd()
realpath()
basename()
chmod()
chown()
fclose()
filemtime()
fgetcsv()
glob()
```### Variable handling Functions
```php
empty()
is_numeric()
```### Program execution Functions
```php
exec()
system()
passthru()
```### Network Functions
```php
gethostname()
gethostbyname()
gethostbynamel()
gethostbyaddr()
ip2long()
long2ip()
```### Misc. Functions
```php
echo()
uniqid()
exit()
die()
getenv()
putenv()
memory_get_usage()
memory_get_peak_usage()
version_compare()
zip_open()
Ternary(condition bool, trueVal, falseVal interface{}) interface{}
```## LICENSE
PHP2Go source code is licensed under the [MIT](https://github.com/syyongx/php2go/blob/master/LICENSE) Licence.