php2go: github.com/openset/php2go/php Index | Files

package php

import "github.com/openset/php2go/php"

PHP built-in function library with Go language

Index

Package Files

addcslashes.go addslashes.go array.go array_change_key_case.go array_chunk.go array_column.go array_count_values.go array_fill.go array_fill_keys.go array_flip.go array_intersect.go array_keys.go array_merge.go array_push.go array_reverse.go base64.go basename.go checkdate.go date.go date_add.go directory.go doc.go echo.go exec.go file_get_contents.go file_put_contents.go filesystem.go is_file.go is_numeric.go json.go math.go md5.go print.go print_r.go sha1.go sleep.go strings.go sys_get_temp_dir.go time.go url.go variable.go

Constants

const (
    CaseLOWER = iota
    CaseUPPER
)

Constants for ArrayChangeKeyCase

const (
    StrPadRight = "STR_PAD_RIGHT"
    StrPadLeft  = "STR_PAD_LEFT"
)

Constants for StrPad

func Abs Uses

func Abs(x float64) float64

Abs - Absolute xue

func Acos Uses

func Acos(x complex128) complex128

Acos - Arc cosine

func Acosh Uses

func Acosh(x complex128) complex128

Acosh - Inverse hyperbolic cosine

func Addcslashes Uses

func Addcslashes(s string, c byte) string

Addcslashes - Quote string with slashes in a C style

func Addslashes Uses

func Addslashes(s string) string

Addslashes - Quote string with slashes

func Array Uses

func Array(v ...interface{}) []interface{}

Array - Create an array

func ArrayColumn Uses

func ArrayColumn(arrayMap map[string]map[string]interface{}, columnKey string) (r []interface{})

ArrayColumn — Return the values from a single column in the input array

func ArrayCountValues Uses

func ArrayCountValues(s []interface{}) map[interface{}]uint

ArrayCountValues — Counts all the values of an array

func ArrayFill Uses

func ArrayFill(startIndex uint, num uint, value interface{}) map[uint]interface{}

ArrayFill - Fill an array with values

func ArrayFillKeys Uses

func ArrayFillKeys(keys []interface{}, value interface{}) map[interface{}]interface{}

ArrayFillKeys - Fill an array with values, specifying keys

func ArrayFlip Uses

func ArrayFlip(arrayMap map[interface{}]interface{}) map[interface{}]interface{}

ArrayFlip - Exchanges all keys with their associated values in an array

func ArrayIntersect Uses

func ArrayIntersect(nums1, nums2 []int) []int

ArrayIntersect — Computes the intersection of arrays

func ArrayKeys Uses

func ArrayKeys(data map[string]interface{}) []string

ArrayKeys - get keys of map data as a Array in php,the keys you want always is string or number here,let it be string

func ArrayMerge Uses

func ArrayMerge(arr ...[]interface{}) []interface{}

ArrayMerge — Merge one or more arrays

func ArrayPush Uses

func ArrayPush(s *[]string, args ...string)

ArrayPush - Push one or more elements onto the end of array

func ArrayReverse Uses

func ArrayReverse(s []interface{}) []interface{}

ArrayReverse - Return an array with elements in reverse order

func Asin Uses

func Asin(x complex128) complex128

Asin - Arc sine

func Asinh Uses

func Asinh(x complex128) complex128

Asinh - Inverse hyperbolic sine

func Atan Uses

func Atan(x complex128) complex128

Atan - Arc tangent

func Atan2 Uses

func Atan2(y, x float64) float64

Atan2 - Arc tangent of two variables

func Atanh Uses

func Atanh(x complex128) complex128

Atanh - Inverse hyperbolic tangent

func Base64Decode Uses

func Base64Decode(s string) (string, error)

Base64Decode - Decodes data encoded with MIME base64

func Base64Encode Uses

func Base64Encode(s string) string

Base64Encode - Encodes data with MIME base64

func BaseConvert Uses

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

BaseConvert - Convert a number between arbitrary bases

func Basename Uses

func Basename(s string, suffix ...string) string

Basename - Returns trailing name component of path

func Bin2hex Uses

func Bin2hex(b string) string

Bin2hex - Convert binary data into hexadecimal representation

func Bindec Uses

func Bindec(b string) int64

Bindec - Binary to decimal

func Boolval Uses

func Boolval(val interface{}) bool

Boolval - Get the boolean value of a variable

func Ceil Uses

func Ceil(x float64) float64

Ceil - Round fractions up

func Chdir Uses

func Chdir(dir string) error

Chdir - Change directory

func Checkdate Uses

func Checkdate(month, day, year uint) bool

Checkdate - Validate a Gregorian date

func Chmod Uses

func Chmod(name string, mode os.FileMode) error

Chmod - Changes file mode

func Chown Uses

func Chown(name string, uid int, gid int) error

Chown - Chown changes the numeric uid and gid of the named file.

func Chr Uses

func Chr(ascii int) string

Chr - Return a specific character

func Closedir Uses

func Closedir(fd int) (err error)

Closedir - Close directory's handle

func Copy Uses

func Copy(dstName string, srcName string) (written int64, err error)

Copy - Copies file

func Cos Uses

func Cos(x float64) float64

Cos - Cosine

func Cosh Uses

func Cosh(x float64) float64

Cosh - Hyperbolic cosine

func Count Uses

func Count(v []interface{}) int

Count - Count all elements in an array, or something in an object

func Date Uses

func Date(format string, ts ...time.Time) string

Date - Format a local time/date

func DateAdd Uses

func DateAdd(t time.Time, years int, months int, days int) time.Time

DateAdd - Adds an amount of days, months, years, hours, minutes and seconds to a DateTime object

func Decbin Uses

func Decbin(x int64) string

Decbin - Decimal to binary

func Dechex Uses

func Dechex(x int64) string

Dechex - Decimal to hexadecimal

func Decoct Uses

func Decoct(x int64) string

Decoct - Decimal to octal

func Delete Uses

func Delete(name string) error

Delete - Deletes a file

func Dirname Uses

func Dirname(dirPth string) ([]os.FileInfo, error)

Dirname - Returns a parent directory's path

func Echo Uses

func Echo(args ...interface{})

Echo - Output one or more strings

func Empty Uses

func Empty(v interface{}) bool

Empty - Determine whether a variable is empty

func Exec Uses

func Exec(s string)

Exec - Execute an external program

func Exp Uses

func Exp(x float64) float64

Exp - Calculates the exponent of e

func Explode Uses

func Explode(s, sep string) []string

Explode - Split a string by string

func Expm1 Uses

func Expm1(x float64) float64

Expm1 - Returns exp(number) - 1 computed in a way that is accurate even when the value of number is close to zero

func Fclose Uses

func Fclose(file *os.File) error

Fclose - Closes an open file pointer

func FileExists Uses

func FileExists(path string) bool

FileExists - Checks whether a file or directory exists

func FileGetContents Uses

func FileGetContents(filename string) ([]byte, error)

FileGetContents - Reads entire file into a string

func FilePutContents Uses

func FilePutContents(filename string, data []byte) error

FilePutContents - Write data to a file

func Filemtime Uses

func Filemtime(file string) time.Time

Filemtime - Gets file modification time

func Floor Uses

func Floor(x float64) float64

Floor - Round fractions down

func GetHtmlTranslationTable Uses

func GetHtmlTranslationTable() map[string]string

GetHtmlTranslationTable - Returns the translation table used by htmlspecialchars() and htmlentities()

func Getcwd Uses

func Getcwd() (dir string)

Getcwd - Get current directory

func Gettype Uses

func Gettype(v interface{}) string

Gettype - Get the type of a variable

func Hex2bin Uses

func Hex2bin(x string) string

Hex2bin - Decodes a hexadecimally encoded binary string

func Htmlspecialchars Uses

func Htmlspecialchars(s string) string

Htmlspecialchars - Convert special characters to HTML entities

func HtmlspecialcharsDecode Uses

func HtmlspecialcharsDecode(s string) string

HtmlspecialcharsDecode - Convert special HTML entities back to characters

func Implode Uses

func Implode(a []string, sep string) string

Implode - Join array elements with a string

func Intval Uses

func Intval(str string) (int, error)

Intval - Get the integer value of a variable

func IsBool Uses

func IsBool(v interface{}) bool

IsBool - Finds out whether a variable is a boolean

func IsDir Uses

func IsDir(name string) bool

IsDir - Tells whether the filename is a directory

func IsFile Uses

func IsFile(name string) bool

IsFile Tells whether the filename is a regular file

func IsFinite Uses

func IsFinite(f float64, sign int) bool

IsFinite - Finds whether a value is a legal finite number

func IsInfinite Uses

func IsInfinite(f float64, sign int) bool

IsInfinite - Finds whether a value is infinite

func IsNan Uses

func IsNan(f float64) bool

IsNan - Finds whether a value is not a number

func IsNumeric Uses

func IsNumeric(x interface{}) (result bool)

IsNumeric - Finds whether a variable is a number or a numeric string

func IsReadable Uses

func IsReadable(name string) bool

IsReadable - Tells whether a file exists and is readable

func IsWritable Uses

func IsWritable(name string) bool

IsWritable - Tells whether the filename is writable

func IsWriteable Uses

func IsWriteable(name string) bool

IsWriteable - Alias of IsWritable()

func Join Uses

func Join(a []string, sep string) string

Join - Alias of implode()

func JsonDecode Uses

func JsonDecode(data []byte, v interface{}) error

JsonDecode - Decodes a JSON string

func JsonEncode Uses

func JsonEncode(v interface{}) ([]byte, error)

JsonEncode - Returns the JSON representation of a value

func Log Uses

func Log(x float64) float64

Log - Natural logarithm

func Log10 Uses

func Log10(x float64) float64

Log10 - Base-10 logarithm

func Log1p Uses

func Log1p(x float64) float64

Log1p - Returns log(1 + number) computed in a way that is accurate even when the value of number is close to zero

func Ltrim Uses

func Ltrim(s, cutset string) string

Ltrim - Strip whitespace (or other characters) from the beginning of a string

func Max Uses

func Max(x, y float64) float64

Max - Find highest value

func MbStrlen Uses

func MbStrlen(s string) int

MbStrlen - Get string length

func MbSubstr Uses

func MbSubstr(s string, start int, length ...int) string

MbSubstr - Get part of string

func Md5 Uses

func Md5(s string) string

Md5 - Calculate the md5 hash of a string

func Md5File Uses

func Md5File(filename string) string

Md5File - Calculates the md5 hash of a given file

func Min Uses

func Min(x, y float64) float64

Min - Find lowest value

func Mkdir Uses

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

Mkdir - Makes directory

func Nl2br Uses

func Nl2br(s string) string

Nl2br - Inserts HTML line breaks before all newlines in a string

func Ord Uses

func Ord(s byte) byte

Ord - Return ASCII value of character

func ParseStr Uses

func ParseStr(query string) (url.Values, error)

ParseStr - Parses the string into variables

func ParseUrl Uses

func ParseUrl(rawurl string) (*url.URL, error)

ParseUrl - Parse a URL and return its components

func Pi Uses

func Pi() float64

Pi - Get value of pi

func Pow Uses

func Pow(x, y float64) float64

Pow - Exponential expression

func Print Uses

func Print(v interface{})

Print - Output a string

func PrintR Uses

func PrintR(v interface{})

PrintR - Prints human-readable information about a variable

func Rand Uses

func Rand(args ...int) int

Rand - Generate a random integer

func Rawurldecode Uses

func Rawurldecode(s string) (string, error)

Rawurldecode - Decodes URL-encoded string

func Rawurlencode Uses

func Rawurlencode(s string) string

Rawurlencode - URL-encode according to RFC 3986

func Realpath Uses

func Realpath(name string) string

Realpath - Returns canonicalized absolute pathname

func Rename Uses

func Rename(oldpath, newpath string) error

Rename - Renames a file or directory

func Round Uses

func Round(x float64) float64

Round - Rounds a float

func Rtrim Uses

func Rtrim(s, cutset string) string

Rtrim - Strip whitespace (or other characters) from the end of a string

func Sha1 Uses

func Sha1(s string) string

Sha1 - Calculate the sha1 hash of a string

func Sha1File Uses

func Sha1File(filename string) string

Sha1File - Calculates the md5 hash of a given file

func Sin Uses

func Sin(x float64) float64

Sin - Sine

func Sinh Uses

func Sinh(x float64) float64

Sinh - Hyperbolic sine

func Sleep Uses

func Sleep(s int64)

Sleep - Delay execution

func Sqrt Uses

func Sqrt(x float64) float64

Sqrt - Square root

func StrPad Uses

func StrPad(s string, length int, args ...string) string

StrPad - Pad a string to a certain length with another string

func StrRepeat Uses

func StrRepeat(s string, count int) string

StrRepeat - Repeat a string

func StrReplace Uses

func StrReplace(s, old, new string, n int) string

StrReplace - Replace all occurrences of the search string with the replacement string

func StripTags Uses

func StripTags(s string) string

StripTags - Strip HTML and PHP tags from a string

func Stripos Uses

func Stripos(s, substr string) int

Stripos - Find the position of the first occurrence of a case-insensitive substring in a string

func Strlen Uses

func Strlen(s string) int

Strlen - Get string length

func Strpos Uses

func Strpos(s, substr string) int

Strpos - Find the position of the first occurrence of a substring in a string

func Strrchr Uses

func Strrchr(s, substr string) string

Strrchr - Find the last occurrence of a character in a string

func Strrev Uses

func Strrev(s string) string

Strrev - Reverse a string

func Strripos Uses

func Strripos(s, substr string) int

Strripos - Find the position of the last occurrence of a case-insensitive substring in a string

func Strrpos Uses

func Strrpos(s, substr string) int

Strrpos - Find the position of the last occurrence of a substring in a string

func Strstr Uses

func Strstr(s, substr string) int

Strstr - Find the first occurrence of a string

func Strtolower Uses

func Strtolower(s string) string

Strtolower - Make a string lowercase

func Strtoupper Uses

func Strtoupper(s string) string

Strtoupper - Make a string uppercase

func Strval Uses

func Strval(val interface{}) string

Strval - Get string value of a variable

func Substr Uses

func Substr(s string, start int, length ...int) string

Substr - Return part of a string

func SubstrCount Uses

func SubstrCount(s, substr string) int

SubstrCount - Count the number of substring occurrences

func SysGetTempDir Uses

func SysGetTempDir() string

SysGetTempDir - Returns directory path used for temporary files

func Tan Uses

func Tan(x float64) float64

Tan - Tangent

func Tanh Uses

func Tanh(x float64) float64

Tanh - Hyperbolic tangent

func Time Uses

func Time() int64

Time - Return current Unix timestamp

func Trim Uses

func Trim(s, cutset string) string

Trim - Strip whitespace (or other characters) from the beginning and end of a string

func Ucfirst Uses

func Ucfirst(s string) string

Ucfirst - Make a string's first character uppercase

func Unlink(name string) error

Unlink - Deletes a file

func Urldecode Uses

func Urldecode(s string) (string, error)

Urldecode - Decodes URL-encoded string

func Urlencode Uses

func Urlencode(s string) string

Urlencode - URL-encodes string

type ArrayMap Uses

type ArrayMap map[string]interface{}

ArrayMap is one of Array type

func ArrayChangeKeyCase Uses

func ArrayChangeKeyCase(arr ArrayMap, Case int) ArrayMap

ArrayChangeKeyCase - Changes the case of all keys in an array

type ArraySlice Uses

type ArraySlice []interface{}

ArraySlice type

func ArrayChunk Uses

func ArrayChunk(input ArraySlice, size int) ArraySlice

ArrayChunk - Split an array into chunks

Package php imports 26 packages (graph) and is imported by 1 packages. Updated 2019-07-24. Refresh now. Tools for package owners.