php

package module
v0.0.0-...-fe70341 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2020 License: Apache-2.0 Imports: 23 Imported by: 1

README

php

php functions for Go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Empty = php2go.Empty

Empty empty()

View Source
var Exec = php2go.Exec

Exec exec() returnVar, 0: succ; 1: fail Return the last line from the result of the command. command format eg:

"ls -a"
"/bin/bash -c \"ls -a\""
View Source
var IsNumeric = php2go.IsNumeric

IsNumeric is_numeric() Numeric strings consist of optional sign, any number of digits, optional decimal part and optional exponential part. Thus +0123.45e6 is a valid numeric value. In PHP hexadecimal (e.g. 0xf4c3b00c) is not supported, but IsNumeric is supported.

View Source
var ParseURL = php2go.ParseURL

ParseURL parse_url() Parse a URL and return its components -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment

View Source
var Passthru = php2go.Passthru

Passthru passthru() returnVar, 0: succ; 1: fail

View Source
var System = php2go.System

System system() returnVar, 0: succ; 1: fail Returns the last line of the command output on success, and "" on failure.

Functions

func Abs

func Abs(number float64) float64

Abs abs()

func Addslashes

func Addslashes(str string) string

Addslashes addslashes()

func Base64Decode

func Base64Decode(data string) (string, error)

Base64Decode base64_decode()

func Base64Encode

func Base64Encode(data string) string

Base64Encode base64_encode()

func BaseConvert

func BaseConvert(number string, frombase, tobase int) (string, error)

BaseConvert base_convert()

func Basename

func Basename(path string) string

Basename basename()

func Bin2hex

func Bin2hex(str string) (string, error)

Bin2hex bin2hex()

func Bindec

func Bindec(str string) (string, error)

Bindec bindec()

func Ceil

func Ceil(value float64) float64

Ceil ceil()

func Chmod

func Chmod(filename string, mode os.FileMode) bool

Chmod chmod()

func Chown

func Chown(filename string, uid, gid int) bool

Chown chown()

func Copy

func Copy(source, dest string) (bool, error)

Copy copy()

func Date

func Date(format string, timestamp int64) string

Date date() Date("2006-01-02", 1520131400)

func Decbin

func Decbin(number int64) string

Decbin decbin()

func Dechex

func Dechex(number int64) string

Dechex dechex()

func Decoct

func Decoct(number int64) string

Decoct decoct()

func Delete

func Delete(filename string) error

Delete delete()

func Echo

func Echo(args ...interface{})

Echo echo

func Explode

func Explode(delimiter, str string) []string

Explode explode()

func Fclose

func Fclose(handle *os.File) error

Fclose fclose()

func Fgetcsv

func Fgetcsv(handle *os.File, length int, delimiter rune) ([][]string, error)

Fgetcsv fgetcsv()

func FileExists

func FileExists(filename string) bool

FileExists file_exists()

func FileGetContents

func FileGetContents(filename string) (string, error)

php file_get_contents()

func FilePutContents

func FilePutContents(filename string, data string, mode os.FileMode) error

php file_put_contents()

func FileSize

func FileSize(filename string) (int64, error)

FileSize filesize()

func Filemtime

func Filemtime(filename string) (int64, error)

Filemtime filemtime()

func Floor

func Floor(value float64) float64

Floor floor()

func Getcwd

func Getcwd() (string, error)

Getcwd getcwd()

func Gethostbyaddr

func Gethostbyaddr(ipAddress string) (string, error)

Gethostbyaddr gethostbyaddr() Get the Internet host name corresponding to a given IP address

func Gethostbyname

func Gethostbyname(hostname string) (string, error)

Gethostbyname gethostbyname() Get the IPv4 address corresponding to a given Internet host name

func Gethostbynamel

func Gethostbynamel(hostname string) ([]string, error)

Gethostbynamel gethostbynamel() Get a list of IPv4 addresses corresponding to a given Internet host name

func Gethostname

func Gethostname() (string, error)

Gethostname gethostname()

func Glob

func Glob(pattern string) ([]string, error)

Glob glob()

func HTMLEntityDecode

func HTMLEntityDecode(str string) string

HTMLEntityDecode html_entity_decode()

func HTTPBuildQuery

func HTTPBuildQuery(queryData url.Values) string

HTTPBuildQuery http_build_query()

func Hex2bin

func Hex2bin(data string) (string, error)

Hex2bin hex2bin()

func Hexdec

func Hexdec(str string) (int64, error)

Hexdec hexdec()

func Htmlentities

func Htmlentities(str string) string

Htmlentities htmlentities()

func Htmlspecialchars

func Htmlspecialchars(str string) string

func HtmlspecialcharsDecode

func HtmlspecialcharsDecode(str string) string

func IP2long

func IP2long(ipAddress string) uint32

IP2long ip2long() IPv4

func Implode

func Implode(glue string, pieces []string) string

Implode implode()

func IsDir

func IsDir(filename string) (bool, error)

IsDir is_dir()

func IsFile

func IsFile(filename string) bool

IsFile is_file()

func IsNan

func IsNan(val float64) bool

IsNan is_nan()

func IsReadable

func IsReadable(filename string) bool

IsReadable is_readable()

func IsWriteable

func IsWriteable(filename string) bool

IsWriteable is_writeable()

func Join

func Join(glue string, pieces []string) string

Join join() Join array elements with a string

func Lcfirst

func Lcfirst(str string) string

Lcfirst lcfirst()

func Long2ip

func Long2ip(properAddress uint32) string

Long2ip long2ip() IPv4

func Max

func Max(nums ...float64) float64

Max max()

func Md5

func Md5(str string) string

Md5 md5()

func Md5File

func Md5File(path string) (string, error)

Md5File md5_file()

func Min

func Min(nums ...float64) float64

Min min()

func Mkdir

func Mkdir(filename string, mode os.FileMode) error

Mkdir mkdir()

func Octdec

func Octdec(str string) (int64, error)

Octdec Octdec()

func Pathinfo

func Pathinfo(path string, options int) map[string]string

Pathinfo pathinfo() -1: all; 1: dirname; 2: basename; 4: extension; 8: filename Usage: Pathinfo("/home/go/path/src/php2go/php2go.go", 1|2|4|8)

func Pi

func Pi() float64

Pi pi()

func Quotemeta

func Quotemeta(str string) string

Quotemeta quotemeta()

func Rand

func Rand(min, max int) int

Rand rand() Range: [0, 2147483647]

func Rawurldecode

func Rawurldecode(str string) (string, error)

Rawurldecode rawurldecode()

func Rawurlencode

func Rawurlencode(str string) string

Rawurlencode rawurlencode()

func Realpath

func Realpath(path string) (string, error)

Realpath realpath()

func Rename

func Rename(oldname, newname string) error

Rename rename()

func Round

func Round(value float64) float64

Round round()

func Sha1

func Sha1(str string) string

Sha1 sha1()

func Sha1File

func Sha1File(path string) (string, error)

Sha1File sha1_file()

func Sleep

func Sleep(seconds int64)

Sleep sleep()

func Stat

func Stat(filename string) (os.FileInfo, error)

Stat stat()

func StrReplace

func StrReplace(search, replace, subject string, count int) string

StrReplace str_replace()

func Stripos

func Stripos(haystack, needle string, offset int) int

Stripos stripos()

func Stripslashes

func Stripslashes(str string) string

Stripslashes stripslashes()

func Strpos

func Strpos(haystack, needle string, offset int) int

Strpos strpos()

func Strripos

func Strripos(haystack, needle string, offset int) int

Strripos strripos()

func Strrpos

func Strrpos(haystack, needle string, offset int) int

Strrpos strrpos()

func Strtolower

func Strtolower(str string) string

Strtolower strtolower()

func Strtoupper

func Strtoupper(str string) string

Strtoupper strtoupper()

func Time

func Time() int64

Time time()

func Touch

func Touch(filename string) (bool, error)

Touch touch()

func URLDecode

func URLDecode(str string) (string, error)

URLDecode urldecode()

func URLEncode

func URLEncode(str string) string

URLEncode urlencode()

func Ucfirst

func Ucfirst(str string) string

Ucfirst ucfirst()

func Ucwords

func Ucwords(str string) string

Ucwords ucwords()

func Uniqid

func Uniqid(prefix string) string

Uniqid uniqid()

func Unlink(filename string) error

php unlink()

func Usleep

func Usleep(microSeconds int64)

Usleep usleep()

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL