php2go - Go 实现 PHP 常用内置函数
【转】http://www.syyong.com/Go/php2go-Use-Golang-to-implement-PHP-s-common-built-in-functions.html
使用Golang实现PHP常用内置函数,目前已经实现了130+函数。
下载&安装
https://github.com/syyongx/php2go
go get github.com/syyongx/php2go
PHP Functions
Date/Time Functions
time()
strtotime()
date()
sleep()
usleep()
String Functions
strpos()
stripos()
strrpos()
strripos()
str_replace()
ucfirst()
ucwords()
substr()
strrev()
number_format()
chunk_split()
str_word_count()
wordwrap()
strlen()
mb_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()
URL Functions
parse_url()
urlencode()
urldecode()
build_http_query()
rawurlencode()
rawurldecode()
base64_encode()
base64_decode()
Array(Slice/Map) Functions
array_fill()
array_flip()
array_keys()
array_values()
array_merge()
array_chunk()
array_pad()
array_slice()
array_rand()
array_column()
array_pop()
array_shift()
array_unshift()
array_diff()
array_combine()
array_reverse()
implode()
Mathematical Functions
abs()
rand()
round()
floor()
ceil()
pi()
max()
min()
decbin()
bindec()
hex2bin()
bin2hex()
dechex()
hexdec()
decoct()
Octdec()
base_convert()
is_nan()
Directory/Filesystem Functions
stat()
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()
disk_free_space()
glob()
Variable handling Functions
empty()
is_numeric()
Program execution Functions
echo()
system()
passthru()
Other Functions
uniqid()
exec()
exit()
die()
getenv()
putenv()
memory_get_usage()
version_compare()
zip_open()
Ternary(condition bool, trueVal, falseVal interface{}) interface{}
LICENSE
php2go source code is licensed under the MIT Licence.
php2go - Go 实现 PHP 常用内置函数的更多相关文章
- MYSQL常用内置函数详解说明
函数中可以将字段名当作变量来用,变量的值就是该列对应的所有值:在整理98在线字典数据时(http://zidian.98zw.com/),有这要一个需求,想从多音字duoyinzi字段值提取第一个拼音 ...
- Python常用模块中常用内置函数的具体介绍
Python作为计算机语言中常用的语言,它具有十分强大的功能,但是你知道Python常用模块I的内置模块中常用内置函数都包括哪些具体的函数吗?以下的文章就是对Python常用模块I的内置模块的常用内置 ...
- MySQL学习笔记_7_MySQL常用内置函数
MySQL常用内置函数 说明: 1)可以用在SELECT/UPDATE/DELETE中,及where,orderby,having中 2)在函数里将字段名作为参数,变量的值就是字段所对应的每一行的值. ...
- PYTHON语言之常用内置函数
一 写在开头本文列举了一些常用的python内置函数.完整详细的python内置函数列表请参见python文档的Built-in Functions章节. 二 python常用内置函数请注意,有关内置 ...
- SqlServer常用内置函数
--======================================= -- SQL常用内置函数 --======================================= --判 ...
- Python的常用内置函数介绍
Python的常用内置函数介绍 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.取绝对值(abs) #!/usr/bin/env python #_*_coding:utf-8_ ...
- python中的运算符及表达式及常用内置函数
知识内容: 1.运算符与表达式 2.for\while初步了解 3.常用内置函数 一.运算符与表达式 python与其他语言一样支持大多数算数运算符.关系运算符.逻辑运算符以及位运算符,并且有和大多数 ...
- python第十八课——常用内置函数
常用内置函数:round(): print(round(3.14),round(3.99)) print(round(3145.926,-2),round(413.575,2)) abs(): pri ...
- Python基础(二)——常用内置函数
1. 常用内置函数 (1)isinstance(object, classinfo) 用于判断一个对象是否为某一类型. object 是实例对象 classinfo 是基本类型如 int, floa ...
随机推荐
- CSS3单选动画
本示例实现了两种单选按钮动画效果,一种是缩放,一种是旋转,以下是html布局以及css样式 html:这里使用了label标签的for属性,以此来绑定radio <div class=" ...
- 『JavaScript』new关键字
原文 new关键字做了什么 在JavaScript中,使用new关键字后,意味着做了如下四件事情: 创建一个新的对象,这个对象的类型是object: 设置这个新的对象的内部.可访问性和[[protot ...
- Windows系统的高效使用
1-WIndows10系统的入门使用 2-如何把系统盘的用户文件转移到其他盘 3-Windows装机软件一般有哪些? 4-Windows系统有哪些比较好用的下载器? 5-Windows系统中的播放器 ...
- 深挖 NGUI 基础 之UICamera (二)
一.UI Camera作用 UICamera需要挂载在摄像机上才能发挥作用 UICamera仅负责 发送NGUI 事件 到 脚本所附加的摄像机中看得到的对象,比如我自定义了NGUI层(在Inspect ...
- packstack安装ironic
KVM Centos7.3虚机 安装openstack Pike版本, 其它版本安装方法类似. packstack目前对NetworkManager 还不支持,我们修改下配置: systemctl d ...
- argos3-simulator
如何修改控制器: CVector2: class CVector2 { friend class CRotationMatrix2; friend class CTransformationMatri ...
- DP入门(2)——DAG上的动态规划
有向无环图(DAG,Directed Acyclic Graph)上的动态规划是学习动态规划的基础.很多问题都可以转化为DAG上的最长路.最短路或路径计数问题. 一.DAG模型 [嵌套矩形问题] 问题 ...
- JavaWeb 基于Session的用户登陆注销实现
通过Session来存储用户的部分登陆信息来验证用户是否在线,这应该时最容易实现的一种Web端方案,本文以SSM(Spring.SpringMVC.myBatis)框架为载体,来具体实现这套登陆系统. ...
- 提高python执行效率的方法
python上手很容易,但是在使用过程中,怎么才能使效率变高呢? 下面说一下提高python执行效率的方法,这里只是说一点,python在引入模块过程中提高效率的方法. 例如: 1.我们要使用os模块 ...
- PHP+AJAX 实现表格实时编辑
https://blog.csdn.net/qq_29627497/article/details/81365107 源码链接:https://pan.baidu.com/s/1fAinVXU-nWt ...