zoukankan      html  css  js  c++  java
  • php2go

    【转】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.

  • 相关阅读:
    Python模块、包、异常、文件(案例)
    jQuery DataTable 删除数据后重新加载
    Python|面向对象
    python开发的学生管理系统
    使用JDK开发WebServrice案例
    Python入门(案例)
    Spring总结以及在面试中的一些问题
    Web Services简单介绍
    Canvas实现文字粒子化,并且绕轴旋转(完善)
    HTML5 Canvas画数字时钟
  • 原文地址:https://www.cnblogs.com/syyong/p/9253789.html
Copyright © 2011-2022 走看看