Documentation ¶
Index ¶
- func DiskFreeSpace(directory string) (uint64, error)
- func DiskTotalSpace(directory string) (uint64, error)
- func Umask(mask int) int
- type PHP
- func (PHP) Abs(number float64) float64
- func (PHP) Addslashes(str string) string
- func (PHP) ArrayChunk(s []interface{}, size int) [][]interface{}
- func (PHP) ArrayColumn(input map[string]map[string]interface{}, columnKey string) []interface{}
- func (PHP) ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
- func (PHP) ArrayFill(startIndex int, num uint, value interface{}) map[int]interface{}
- func (PHP) ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
- func (PHP) ArrayKeyExists(key interface{}, m map[interface{}]interface{}) bool
- func (PHP) ArrayKeys(elements map[interface{}]interface{}) []interface{}
- func (PHP) ArrayMerge(ss ...[]interface{}) []interface{}
- func (PHP) ArrayPad(s []interface{}, size int, val interface{}) []interface{}
- func (PHP) ArrayPop(s *[]interface{}) interface{}
- func (PHP) ArrayPush(s *[]interface{}, elements ...interface{}) int
- func (PHP) ArrayRand(elements []interface{}) []interface{}
- func (PHP) ArrayReverse(s []interface{}) []interface{}
- func (PHP) ArrayShift(s *[]interface{}) interface{}
- func (PHP) ArraySlice(s []interface{}, offset, length uint) []interface{}
- func (PHP) ArrayUnshift(s *[]interface{}, elements ...interface{}) int
- func (PHP) ArrayValues(elements map[interface{}]interface{}) []interface{}
- func (PHP) Base64Decode(str string) (string, error)
- func (PHP) Base64Encode(str string) string
- func (PHP) BaseConvert(number string, frombase, tobase int) (string, error)
- func (PHP) Basename(path string) string
- func (PHP) Bin2hex(str string) (string, error)
- func (PHP) Bindec(str string) (string, error)
- func (PHP) Ceil(value float64) float64
- func (PHP) Checkdate(month, day, year int) bool
- func (PHP) Chmod(filename string, mode os.FileMode) bool
- func (PHP) Chown(filename string, uid, gid int) bool
- func (PHP) Chr(ascii int) string
- func (PHP) ChunkSplit(body string, chunklen uint, end string) string
- func (PHP) Copy(source, dest string) (bool, error)
- func (PHP) Crc32(str string) uint32
- func (PHP) Date(format string, timestamp int64) string
- func (PHP) Decbin(number int64) string
- func (PHP) Dechex(number int64) string
- func (PHP) Decoct(number int64) string
- func (PHP) Delete(filename string) error
- func (PHP) Die(status int)
- func (PHP) Echo(args ...interface{})
- func (PHP) Empty(val interface{}) bool
- func (PHP) Exec(command string, output *[]string, returnVar *int) string
- func (PHP) Exit(status int)
- func (PHP) Explode(delimiter, str string) []string
- func (PHP) Fclose(handle *os.File) error
- func (PHP) Fgetcsv(handle *os.File, length int, delimiter rune) ([][]string, error)
- func (PHP) FileExists(filename string) bool
- func (PHP) FileGetContents(filename string) (string, error)
- func (PHP) FilePutContents(filename string, data string, mode os.FileMode) error
- func (PHP) FileSize(filename string) (int64, error)
- func (PHP) Filemtime(filename string) (int64, error)
- func (PHP) Floor(value float64) float64
- func (PHP) Getcwd() (string, error)
- func (PHP) Getenv(varname string) string
- func (PHP) Gethostbyaddr(ipAddress string) (string, error)
- func (PHP) Gethostbyname(hostname string) (string, error)
- func (PHP) Gethostbynamel(hostname string) ([]string, error)
- func (PHP) Gethostname() (string, error)
- func (PHP) Glob(pattern string) ([]string, error)
- func (PHP) HTMLEntityDecode(str string) string
- func (PHP) HTTPBuildQuery(queryData url.Values) string
- func (PHP) Hex2bin(data string) (string, error)
- func (PHP) Hexdec(str string) (int64, error)
- func (PHP) Htmlentities(str string) string
- func (PHP) IP2long(ipAddress string) uint32
- func (PHP) Implode(glue string, pieces []string) string
- func (PHP) InArray(needle interface{}, haystack interface{}) bool
- func (PHP) IsDir(filename string) (bool, error)
- func (PHP) IsFile(filename string) bool
- func (PHP) IsNan(val float64) bool
- func (PHP) IsNumeric(val interface{}) bool
- func (PHP) IsReadable(filename string) bool
- func (PHP) IsWriteable(filename string) bool
- func (PHP) JSONDecode(data []byte, val interface{}) error
- func (PHP) JSONEncode(val interface{}) ([]byte, error)
- func (PHP) Lcfirst(str string) string
- func (PHP) Levenshtein(str1, str2 string, costIns, costRep, costDel int) int
- func (PHP) Long2ip(properAddress uint32) string
- func (PHP) Ltrim(str string, characterMask ...string) string
- func (PHP) Max(nums ...float64) float64
- func (PHP) MbStrlen(str string) int
- func (PHP) MbStrtoupper(str string) string
- func (PHP) Md5(str string) string
- func (PHP) Md5File(path string) (string, error)
- func (PHP) MemoryGetPeakUsage(realUsage bool) uint64
- func (PHP) MemoryGetUsage(realUsage bool) uint64
- func (PHP) Min(nums ...float64) float64
- func (PHP) Mkdir(filename string, mode os.FileMode) error
- func (PHP) Nl2br(str string, isXhtml bool) string
- func (PHP) NumberFormat(number float64, decimals uint, decPoint, thousandsSep string) string
- func (PHP) Octdec(str string) (int64, error)
- func (PHP) Ord(char string) int
- func (PHP) Pack(order binary.ByteOrder, data interface{}) (string, error)
- func (PHP) ParseStr(encodedString string, result map[string]interface{}) error
- func (PHP) ParseURL(str string, component int) (map[string]string, error)
- func (PHP) Passthru(command string, returnVar *int)
- func (PHP) Pathinfo(path string, options int) map[string]string
- func (PHP) Pi() float64
- func (PHP) Putenv(setting string) error
- func (PHP) Quotemeta(str string) string
- func (PHP) Rand(min, max int) int
- func (PHP) RandomBytes(length int) ([]byte, error)
- func (PHP) RandomInt(min, max int) (int, error)
- func (PHP) Rawurldecode(str string) (string, error)
- func (PHP) Rawurlencode(str string) string
- func (PHP) Realpath(path string) (string, error)
- func (PHP) Rename(oldname, newname string) error
- func (PHP) Round(value float64, precision int) float64
- func (PHP) Rtrim(str string, characterMask ...string) string
- func (PHP) Sha1(str string) string
- func (PHP) Sha1File(path string) (string, error)
- func (PHP) SimilarText(first, second string, percent *float64) int
- func (PHP) Sleep(t int64)
- func (PHP) Soundex(str string) string
- func (PHP) Stat(filename string) (os.FileInfo, error)
- func (PHP) StrRepeat(input string, multiplier int) string
- func (PHP) StrReplace(search, replace, subject string, count int) string
- func (PHP) StrShuffle(str string) string
- func (PHP) StrWordCount(str string) []string
- func (PHP) Stripos(haystack, needle string, offset int) int
- func (PHP) Stripslashes(str string) string
- func (PHP) Strlen(str string) int
- func (PHP) Strpos(haystack, needle string, offset int) int
- func (PHP) Strrev(str string) string
- func (PHP) Strripos(haystack, needle string, offset int) int
- func (PHP) Strrpos(haystack, needle string, offset int) int
- func (PHP) Strstr(haystack string, needle string) string
- func (PHP) Strtolower(str string) string
- func (PHP) Strtotime(format, strtime string) (int64, error)
- func (PHP) Strtoupper(str string) string
- func (PHP) Strtr(haystack string, params ...interface{}) string
- func (PHP) Substr(str string, start uint, length int) string
- func (PHP) System(command string, returnVar *int) string
- func (PHP) Ternary(condition bool, trueVal, falseVal interface{}) interface{}
- func (PHP) Time() int64
- func (PHP) Touch(filename string) (bool, error)
- func (PHP) Trim(str string, characterMask ...string) string
- func (PHP) URLDecode(str string) (string, error)
- func (PHP) URLEncode(str string) string
- func (PHP) Ucfirst(str string) string
- func (PHP) Ucwords(str string) string
- func (PHP) Uniqid(prefix string) string
- func (PHP) Unlink(filename string) error
- func (PHP) Unpack(order binary.ByteOrder, data string) (interface{}, error)
- func (PHP) Usleep(t int64)
- func (PHP) VersionCompare(version1, version2, operator string) bool
- func (PHP) Wordwrap(str string, width uint, br string, cut bool) string
- func (PHP) ZipOpen(filename string) (*zip.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiskFreeSpace ¶
DiskFreeSpace disk_free_space()
func DiskTotalSpace ¶
DiskTotalSpace disk_total_space()
Types ¶
type PHP ¶
type PHP struct{}
func (PHP) ArrayChunk ¶
ArrayChunk array_chunk()
func (PHP) ArrayColumn ¶
ArrayColumn array_column()
func (PHP) ArrayCombine ¶
func (PHP) ArrayCombine(s1, s2 []interface{}) map[interface{}]interface{}
ArrayCombine array_combine()
func (PHP) ArrayFlip ¶
func (PHP) ArrayFlip(m map[interface{}]interface{}) map[interface{}]interface{}
ArrayFlip array_flip()
func (PHP) ArrayKeyExists ¶
ArrayKeyExists array_key_exists()
func (PHP) ArrayKeys ¶
func (PHP) ArrayKeys(elements map[interface{}]interface{}) []interface{}
ArrayKeys array_keys()
func (PHP) ArrayMerge ¶
func (PHP) ArrayMerge(ss ...[]interface{}) []interface{}
ArrayMerge array_merge()
func (PHP) ArrayPop ¶
func (PHP) ArrayPop(s *[]interface{}) interface{}
ArrayPop array_pop() Pop the element off the end of slice
func (PHP) ArrayRand ¶
func (PHP) ArrayRand(elements []interface{}) []interface{}
ArrayRand array_rand()
func (PHP) ArrayReverse ¶
func (PHP) ArrayReverse(s []interface{}) []interface{}
ArrayReverse array_reverse()
func (PHP) ArrayShift ¶
func (PHP) ArrayShift(s *[]interface{}) interface{}
ArrayShift array_shift() Shift an element off the beginning of slice
func (PHP) ArraySlice ¶
ArraySlice array_slice()
func (PHP) ArrayUnshift ¶
ArrayUnshift array_unshift() Prepend one or more elements to the beginning of a slice
func (PHP) ArrayValues ¶
func (PHP) ArrayValues(elements map[interface{}]interface{}) []interface{}
ArrayValues array_values()
func (PHP) Base64Decode ¶
Base64Decode base64_decode()
func (PHP) BaseConvert ¶
BaseConvert base_convert()
func (PHP) ChunkSplit ¶
ChunkSplit chunk_split()
func (PHP) Date ¶
Date date() Date("02/01/2006 15:04:05 PM", 1524799394) Note: the behavior is inconsistent with php's date function
func (PHP) 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\""
func (PHP) FileGetContents ¶
FileGetContents file_get_contents()
func (PHP) FilePutContents ¶
FilePutContents file_put_contents()
func (PHP) Gethostbyaddr ¶
Gethostbyaddr gethostbyaddr() Get the Internet host name corresponding to a given IP address
func (PHP) Gethostbyname ¶
Gethostbyname gethostbyname() Get the IPv4 address corresponding to a given Internet host name
func (PHP) Gethostbynamel ¶
Gethostbynamel gethostbynamel() Get a list of IPv4 addresses corresponding to a given Internet host name
func (PHP) HTMLEntityDecode ¶
HTMLEntityDecode html_entity_decode()
func (PHP) HTTPBuildQuery ¶
HTTPBuildQuery http_build_query()
func (PHP) 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.
func (PHP) JSONDecode ¶
JSONDecode json_decode()
func (PHP) JSONEncode ¶
JSONEncode json_encode()
func (PHP) Levenshtein ¶
Levenshtein levenshtein() costIns: Defines the cost of insertion. costRep: Defines the cost of replacement. costDel: Defines the cost of deletion.
func (PHP) MbStrtoupper ¶
MbStrtoupper mb_strtoupper() Make a string uppercase
func (PHP) MemoryGetPeakUsage ¶
MemoryGetPeakUsage memory_get_peak_usage() return in bytes
func (PHP) MemoryGetUsage ¶
MemoryGetUsage memory_get_usage() return in bytes
func (PHP) NumberFormat ¶
NumberFormat number_format() decimals: Sets the number of decimal points. decPoint: Sets the separator for the decimal point. thousandsSep: Sets the thousands' separator.
func (PHP) ParseStr ¶
ParseStr parse_str() f1=m&f2=n -> map[f1:m f2:n] f[a]=m&f[b]=n -> map[f:map[a:m b:n]] f[a][a]=m&f[a][b]=n -> map[f:map[a:map[a:m b:n]]] f[]=m&f[]=n -> map[f:[m n]] f[a][]=m&f[a][]=n -> map[f:map[a:[m n]]] f[][]=m&f[][]=n -> map[f:[map[]]] // Currently does not support nested slice. f=m&f[a]=n -> error // This is not the same as PHP. a .[[b=c -> map[a___[b:c]
func (PHP) 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
func (PHP) Pathinfo ¶
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 (PHP) RandomBytes ¶
RandomBytes random_bytes()
func (PHP) Rawurldecode ¶
Rawurldecode rawurldecode()
func (PHP) SimilarText ¶
SimilarText similar_text()
func (PHP) StrReplace ¶
StrReplace str_replace()
func (PHP) StrWordCount ¶
StrWordCount str_word_count()
func (PHP) Strtotime ¶
Strtotime strtotime() Strtotime("02/01/2006 15:04:05", "02/01/2016 15:04:05") == 1451747045 Strtotime("3 04 PM", "8 41 PM") == -62167144740
func (PHP) Strtr ¶
Strtr strtr()
If the parameter length is 1, type is: map[string]string Strtr("baab", map[string]string{"ab": "01"}) will return "ba01" If the parameter length is 2, type is: string, string Strtr("baab", "ab", "01") will return "1001", a => 0; b => 1.
func (PHP) System ¶
System system() returnVar, 0: succ; 1: fail Returns the last line of the command output on success, and "" on failure.
func (PHP) VersionCompare ¶
VersionCompare version_compare() The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively. special version strings these are handled in the following order, (any string not found) < dev < alpha = a < beta = b < RC = rc < # < pl = p Usage: VersionCompare("1.2.3-alpha", "1.2.3RC7", '>=') VersionCompare("1.2.3-beta", "1.2.3pl", 'lt') VersionCompare("1.1_dev", "1.2any", 'eq')