Documentation
¶
Index ¶
- func Abs(number float64) float64
- func Addslashes(str string) string
- func Array_chunk(s []interface{}, size int) [][]interface{}
- func Array_column(array interface{}, columnKey string) interface{}
- func Array_combine(s1, s2 []interface{}) map[interface{}]interface{}
- func Array_fill(startIndex int, num uint, value interface{}) map[int]interface{}
- func Array_flip(m map[interface{}]interface{}) map[interface{}]interface{}
- func Array_key_exists(key interface{}, m map[interface{}]interface{}) bool
- func Array_keys(elements map[interface{}]interface{}) []interface{}
- func Array_merge(ss ...[]interface{}) []interface{}
- func Array_pad(s []interface{}, size int, val interface{}) []interface{}
- func Array_pop(s *[]interface{}) interface{}
- func Array_push(s *[]interface{}, elements ...interface{}) int
- func Array_rand(elements []interface{}) []interface{}
- func Array_reverse(s []interface{}) []interface{}
- func Array_shift(s *[]interface{}) interface{}
- func Array_slice(s []interface{}, offset, length uint) []interface{}
- func Array_unshift(s *[]interface{}, elements ...interface{}) int
- func Array_values(elements map[interface{}]interface{}) []interface{}
- func Base_convert(number string, frombase, tobase int) (string, error)
- func Basename(path string) string
- func Bin2hex(str string) (string, error)
- func Bindec(str string) (string, error)
- func Ceil(value float64) float64
- func Chmod(filename string, mode os.FileMode) bool
- func Chr(ascii int) string
- func Chunk_split(body string, chunklen uint, end string) string
- func Copy(source, dest string) (bool, error)
- func Decbin(number int64) string
- func Dechex(number int64) string
- func Decoct(number int64) string
- func Die(status int)
- func Empty(val interface{}) bool
- func Exec(command string, output *[]string, returnVar *int) string
- func Exit(status int)
- func Fgetcsv(handle *os.File, length int, delimiter rune) ([][]string, error)
- func File_exists(filename string) bool
- func File_get_contents(filename string) (string, error)
- func File_put_contents(filename string, data string, mode os.FileMode) error
- func Filesize(filename string) (int64, error)
- func Floor(value float64) float64
- func Getcwd() (string, error)
- func Getenv(varname string) string
- func Gethostbyaddr(ipAddress string) (string, error)
- func Gethostbyname(hostname string) (string, error)
- func Gethostbynamel(hostname string) ([]string, error)
- func Gethostname() (string, error)
- func Glob(pattern string) ([]string, error)
- func HTMLEntityDecode(str string) string
- func Hex2bin(data string) (string, error)
- func Hexdec(str string) (int64, error)
- func Htmlentities(str string) string
- func Implode(glue string, pieces []string) string
- func Ip2long(ipAddress string) uint32
- func IsNan(val float64) bool
- func IsReadable(filename string) bool
- func IsWriteable(filename string) bool
- func Is_dir(filename string) (bool, error)
- func Is_numeric(val interface{}) bool
- func Long2ip(properAddress uint32) string
- func Max(nums ...float64) float64
- func Mb_strlen(str string) int
- func MemoryGetUsage(realUsage bool) uint64
- func Min(nums ...float64) float64
- func MkDir(dir string, mode os.FileMode)
- func Nl2br(str string, isXhtml bool) string
- func Number_format(number float64, decimals uint, decPoint, thousandsSep string) string
- func Octdec(str string) (int64, error)
- func Ord(char string) int
- func Pack(order binary.ByteOrder, data interface{}) (string, error)
- func ParseURL(str string, component int) (map[string]string, error)
- func Passthru(command string, returnVar *int)
- func Pathinfo(path string, options int) map[string]string
- func Putenv(setting string) error
- func Quotemeta(str string) string
- func Realpath(path string) (string, error)
- func Rename(oldname, newname string) error
- func Round(value float64, args ...int) float64
- func Sleep(t int64)
- func Stat(filename string) (os.FileInfo, error)
- func Str_repeat(input string, multiplier int) string
- func Str_shuffle(str string) string
- func Stripslashes(str string) string
- func System(command string, returnVar *int) string
- func Touch(filename string) (bool, error)
- func Uniqid(prefix string) string
- func Unpack(order binary.ByteOrder, data string) (interface{}, error)
- func Usleep(t int64)
- func Version_compare(version1, version2, operator string) bool
- func Wordwrap(str string, width uint, br string, cut bool) string
- func Zip_open(filename string) (*zip.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Array_column ¶
func Array_column(array interface{}, columnKey string) interface{}
从数组中取出所有某个键名的值 支持数据类型:
[]map[string]interface {} map[string]map[string]interface {}
func Array_combine ¶
func Array_combine(s1, s2 []interface{}) map[interface{}]interface{}
通过合并两个数组来创建一个新数组,其中的一个数组元素为键名,另一个数组的元素为键值。
func Array_fill ¶
用给定的键值填充
func Array_flip ¶
func Array_flip(m map[interface{}]interface{}) map[interface{}]interface{}
反转/交换数组中所有的键名以及它们关联的键值。
func Array_key_exists ¶
func Array_key_exists(key interface{}, m map[interface{}]interface{}) bool
检查数组/切片/map中是否存在指定的键名
func Array_keys ¶
func Array_keys(elements map[interface{}]interface{}) []interface{}
返回包含数组中所有键名的一个新数组
func Array_slice ¶
func Array_slice(s []interface{}, offset, length uint) []interface{}
在数组中根据条件切出一段值
func Base_convert ¶
把十六进制数转换为八进制数
func Chr ¶
将ASCII码值转化为字符串。 此函数与PHP的Mb_chr()函数转换结果一致,与php的chr()转换结果不一致 因为golang统一是utf-8编码,rune uses UTF-8,ASCII码值在127以下,127一下是可以和php对等,超过127的ASCII值翻译就无法对等了 曹尼玛在移植php discuz经典加解密算法过来时,php和golang的这个差别折腾了半天
func Chunk_split ¶
把字符串按指定长度分隔并拼接分隔符 例如在每个字符后分割一次字符串,并在每个分割后添加 ".": str := "tangsan"; Chunk_split(str,1,"."); 得到:taa.a.n.g.s.a.n.
func File_put_contents ¶
写入文件
func Gethostbynamel ¶
获取互联网主机名对应的 IPv4 地址列表,即获取同ip网站
func Is_numeric ¶
func Is_numeric(val interface{}) bool
判断是否为数值 数字串由可选符号、任意位数、可选小数部分和可选指数部分组成。 因此+0123.45e6是一个有效的数值。 在PHP中不支持十六进制(例如0xf4c3b00c),但这里这个支持Is_numeric支持
func Number_format ¶
通过千位分组来格式化数字。 decimals: 设置保留几位小数 decPoint: 设置小数点的分隔符。 thousandsSep: 设置千位分隔符。
func ParseURL ¶
解析URL,得到url的组成部分 -1: all; 1: scheme; 2: host; 4: port; 8: user; 16: pass; 32: path; 64: query; 128: fragment
func Pathinfo ¶
获取文件路径相关信息 -1: all; 1: dirname; 2: basename; 4: extension; 8: filename 用法: Pathinfo("/home/go/path/src/php2go/php2go.go", 1|2|4|8)
func Version_compare ¶
golang版本比较 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')
Types ¶
This section is empty.