Documentation
¶
Overview ¶
MIT License
Copyright (c) 2020 KING ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
- Constants
- func Abs(x float64) float64
- func Acos(x float64) float64
- func Acosh(x float64) float64
- func Array(v ...interface{}) interface{}
- func ArrayColumn(arrayMap map[string]map[string]interface{}, column string) (ret []interface{})
- func ArrayCombine(arrK ArraySlice, arrV ArraySlice) (arrayCombineMap, error)
- func ArrayCountValues(array []interface{}) map[interface{}]uint
- func ArrayFill(startIndex int, num uint, value interface{}) map[int]interface{}
- func ArrayFillKeys(keys []interface{}, value interface{}) map[interface{}]interface{}
- func ArrayFlip(arr map[interface{}]interface{}) map[interface{}]interface{}
- func ArrayKeyExists(key interface{}, arr map[interface{}]interface{}) bool
- func ArrayKeys(arr map[interface{}]interface{}) (r []interface{})
- func ArrayMapMap(f func(item interface{}) interface{}, arr map[string]interface{}) (r []interface{})
- func ArrayMapSlice(f func(item interface{}) interface{}, arr []interface{}) (r []interface{})
- func ArrayMerge(arr ...interface{}) []interface{}
- func ArrayPop(s []interface{}) []interface{}
- func ArrayProduct(p []float64) float64
- func ArrayPush(arr *[]interface{}, p ...interface{})
- func ArrayValues(arr map[interface{}]interface{}) []interface{}
- func ArrayWalkMap(arr map[interface{}]interface{}, f func(item interface{}, key interface{}))
- func ArrayWalkSlice(arr *[]interface{}, f func(item interface{}, key interface{}))
- func Asin(x float64) float64
- func Asinh(x float64) float64
- func Atan(x float64) float64
- func Atan2(x, y float64) float64
- func Atanh(x float64) float64
- func Base64Decode(s string) (string, error)
- func Base64Encode(s string) string
- func Bindec(t string) int64
- func Ceil(x float64) float64
- func Checkdate(m, d, y int) bool
- func Chgrp(name string, uid, gid int) bool
- func Chmod(name string, mode os.FileMode) bool
- func Chown(name string, uid, gid int) bool
- func ChunkSplit(body string, length uint, end string) string
- func Copy(source, dest string) bool
- func Cos(x float64) float64
- func Cosh(x float64) float64
- func Count(v []interface{}) int
- func Date(format string, timestamp int64) string
- func Delete(filename string) bool
- func Dirname(dirPath string)
- func Echo(orgs ...interface{})
- func Empty(s interface{}) bool
- func Explode(delimiter, s string) []string
- func FileGetContents(filename string) ([]byte, error)
- func FilePutContents(filename string, data []byte) error
- func GetHeaders(u string) http.Header
- func Glob(pattern string) []string
- func HttpBuildQuery(s map[string]string) (rs string)
- func Implode(sep string, ss []string) string
- func IsBool(v interface{}) bool
- func IsDir(name string) bool
- func IsDouble(v interface{}) bool
- func IsFile(name string) bool
- func IsFloat(v interface{}) bool
- func IsInt(v interface{}) bool
- func IsInteger(v interface{}) bool
- func IsReadable(filename string) bool
- func IsWritable(filename string) bool
- func Join(sep string, ss []string) string
- func Lcfirst(s string) string
- func Ltrim(s string) string
- func MbStrlen(s string) int
- func Md5(s string) string
- func Md5File(path string) (string, error)
- func Mkdir(name string, mode os.FileMode) bool
- func ParseUrl(rawurl string) (*url.URL, error)
- func Pi() float64
- func Pow(base, exp float64) float64
- func Print(v ...interface{})
- func PrintR(v ...interface{})
- func Printf(s interface{})
- func Rawurldecode(s string) string
- func Rawurlencode(s string) string
- func Realpath(filename string) string
- func Rename(oldName, newName string) bool
- func Rmdir(path string) bool
- func Rtrim(s string) string
- func Scandir(dirname string) ([]os.FileInfo, error)
- func Sha1(s string) string
- func Sha1File(path string) (string, error)
- func Sin(x float64) float64
- func Sinh(x float64) float64
- func Sleep(s int64)
- func Sort(arr []int)
- func Stat(filename string) (os.FileInfo, error)
- func StrRepeat(s string, multiplier int) string
- func StrReplace(search, old, new string, count int) string
- func StrShuffle(s string) string
- func StrSplit(s string, sep string, n int) []string
- func StrWordCount(s string) []string
- func Stripos(haystack, needle string, offset int) int
- func Strlen(s string) int
- func Strpos(haystack, needle string, offset int) int
- func Strrev(str string) string
- func Strripos(haystack, needle string, offset int) int
- func Strrpos(haystack, needle string, offset int) int
- func Strstr(haystack, needle string) string
- func Strtolower(s string) string
- func Strtoupper(s string) string
- func Strtr(haystack string, params ...interface{}) string
- func Substr(s string, start uint, l int) string
- func Tan(x float64) float64
- func Time() int64
- func Trim(s string) string
- func Ucfirst(str string) string
- func Ucwords(s string) string
- func Unlink(filename string) bool
- func Urldecode(s string) string
- func Urlencode(s string) string
- func Usleep(ms int64)
- func VarDump(v ...interface{})
- func Wordwrap(s string, width uint, br string, cut bool) string
- type ArrMap
- type ArraySlice
Constants ¶
const ( CaseLower = iota CaseUpper )
Variables ¶
This section is empty.
Functions ¶
func Acos ¶
https://www.php.net/manual/zh/function.acos.php 反余弦函数 x float64 度数
func Acosh ¶
https://www.php.net/manual/zh/function.acosh.php 反双曲余弦函数 x float64 度数
func ArrayColumn ¶
https://www.php.net/manual/zh/function.array-column.php array_column 获取指定的key值 todo index第三个参数待实现
func ArrayCombine ¶
func ArrayCombine(arrK ArraySlice, arrV ArraySlice) (arrayCombineMap, error)
https://www.php.net/manual/zh/function.array-combine.php array_combine()
func ArrayCountValues ¶
func ArrayCountValues(array []interface{}) map[interface{}]uint
https://www.php.net/manual/zh/function.array-count-values.php array_count_values
func ArrayFill ¶
https://www.php.net/manual/zh/function.array-fill.php array_fill 数据填充 具体操作请看php链接
func ArrayFillKeys ¶
func ArrayFillKeys(keys []interface{}, value interface{}) map[interface{}]interface{}
https://www.php.net/manual/zh/function.array-fill-keys.php array_fill_keys()
func ArrayFlip ¶
func ArrayFlip(arr map[interface{}]interface{}) map[interface{}]interface{}
https://www.php.net/manual/zh/function.array-flip.php array_flip
func ArrayKeyExists ¶
func ArrayKeyExists(key interface{}, arr map[interface{}]interface{}) bool
https://www.php.net/manual/zh/function.array-key-exists.php array_key_exists()
func ArrayKeys ¶
func ArrayKeys(arr map[interface{}]interface{}) (r []interface{})
https://www.php.net/manual/zh/function.array_keys.php array_keys()
func ArrayMapMap ¶
func ArrayMapMap(f func(item interface{}) interface{}, arr map[string]interface{}) (r []interface{})
https://www.php.net/manual/zh/function.array-map.php array_map map
func ArrayMapSlice ¶
func ArrayMapSlice(f func(item interface{}) interface{}, arr []interface{}) (r []interface{})
https://www.php.net/manual/zh/function.array-map.php array_map slice
func ArrayMerge ¶
func ArrayMerge(arr ...interface{}) []interface{}
https://www.php.net/manual/zh/function.array-merge.php array_merge
func ArrayPop ¶
func ArrayPop(s []interface{}) []interface{}
https://www.php.net/manual/zh/function.array-pop.php array_pop
func ArrayProduct ¶
https://www.php.net/manual/zh/function.array-product.php array_product
func ArrayPush ¶
func ArrayPush(arr *[]interface{}, p ...interface{})
https://www.php.net/manual/zh/function.array-push.php array_push()
func ArrayValues ¶
func ArrayValues(arr map[interface{}]interface{}) []interface{}
https://www.php.net/manual/zh/function.array-values.php array-values()
func ArrayWalkMap ¶
func ArrayWalkMap(arr map[interface{}]interface{}, f func(item interface{}, key interface{}))
https://www.php.net/manual/zh/function.array-walk.php array_walk map todo 待完善
func ArrayWalkSlice ¶
func ArrayWalkSlice(arr *[]interface{}, f func(item interface{}, key interface{}))
https://www.php.net/manual/zh/function.array-walk.php array_walk slice todo 待完善
func Asin ¶
https://www.php.net/manual/zh/function.asin.php 反正弦函数 x float64 度数
func Asinh ¶
https://www.php.net/manual/zh/function.asinh.php 反双曲正弦函数 x float64 度数
func Atan ¶
https://www.php.net/manual/zh/function.atan.php 反正切 x float64 度数
func Atan2 ¶
https://www.php.net/manual/zh/function.atan2.php 两个参数的反正切 x y float64 度数
func Atanh ¶
https://www.php.net/manual/zh/function.atanh.php 反双曲正切 x float64 度数
func Base64Decode ¶
https://www.php.net/manual/zh/function.base64-encode.php base64_decode
func Base64Encode ¶
https://www.php.net/manual/zh/function.base64-encode.php base64_encode
func Checkdate ¶
https://www.php.net/manual/zh/function.checkdate.php checkdate()
func ChunkSplit ¶
https://www.php.net/manual/zh/function.chunk-split.php chunk_split()
func Cos ¶
https://www.php.net/manual/zh/function.cos.php 增加余弦函数 x float64 度数
func Cosh ¶
https://www.php.net/manual/zh/function.cosh.php 双曲余弦 x float64 度数
func Dirname ¶
func Dirname(dirPath string)
https://www.php.net/manual/zh/function.dirname.php dirname()
func Explode ¶
https://www.php.net/manual/zh/function.explode.php explode()
func FileGetContents ¶
https://www.php.net/manual/zh/function.file-get-contents.php file_get_contents todo 这个只能获取本地地址内容 http 或者 https远程链接还是获取不到的内容的 需要使用网络包获取
func FilePutContents ¶
https://www.php.net/manual/zh/function.file-put-contents.php file_put_contents
func GetHeaders ¶
https://www.php.net/manual/zh/function.get-headers.php get_headers()
func HttpBuildQuery ¶
https://www.php.net/manual/zh/function.http-build-query.php http_build_query()
func IsDouble ¶
func IsDouble(v interface{}) bool
https://www.php.net/manual/zh/function.is-double.php is_double float64 float32
func IsFile ¶
https://www.php.net/manual/zh/function.is-file.php is_file()
func IsFloat ¶
func IsFloat(v interface{}) bool
https://www.php.net/manual/zh/function.is-float.php is_float float32
func IsInt ¶
func IsInt(v interface{}) bool
https://www.php.net/manual/zh/function.is-int.php is_int int32
func IsInteger ¶
func IsInteger(v interface{}) bool
https://www.php.net/manual/zh/function.is-integer.php is_integer int32
func IsReadable ¶
https://www.php.net/manual/zh/function.is-readable.php is_readable()
func IsWritable ¶
https://www.php.net/manual/zh/function.is-writable.php is_writable()
func Lcfirst ¶
https://www.php.net/manual/zh/function.lcfirst.php lcfirst()
func MbStrlen ¶
https://www.php.net/manual/zh/function.mb-strlen.php mb_strlen
func Md5File ¶
https://www.php.net/manual/zh/function.md5-file.php md5_file
func ParseUrl ¶
https://www.php.net/manual/zh/function.parse-url.php parse_url()
func PrintR ¶
func PrintR(v ...interface{})
https://www.php.net/manual/zh/function.print-r.php print_r()
func Printf ¶
func Printf(s interface{})
*
普通占位符
占位符 说明 举例 输出
%v 相应值的默认格式。 Printf("%v", people) {zhangsan},
%+v 打印结构体时,会添加字段名 Printf("%+v", people) {Name:zhangsan}
%#v 相应值的Go语法表示 Printf("#v", people) main.Human{Name:"zhangsan"}
%T 相应值的类型的Go语法表示 Printf("%T", people) main.Human
%% 字面上的百分号,并非值的占位符 Printf("%%") %
布尔占位符
占位符 说明 举例 输出
%t true 或 false。 Printf("%t", true) true
整数占位符
占位符 说明 举例 输出
%b 二进制表示 Printf("%b", 5) 101
%c 相应Unicode码点所表示的字符 Printf("%c", 0x4E2D) 中
%d 十进制表示 Printf("%d", 0x12) 18
%o 八进制表示 Printf("%d", 10) 12
%q 单引号围绕的字符字面值,由Go语法安全地转义 Printf("%q", 0x4E2D) '中'
%x 十六进制表示,字母形式为小写 a-f Printf("%x", 13) d
%X 十六进制表示,字母形式为大写 A-F Printf("%x", 13) D
%U Unicode格式:U+1234,等同于 "U+%04X" Printf("%U", 0x4E2D) U+4E2D
字符串与字节切片
占位符 说明 举例 输出
%s 输出字符串表示(string类型或[]byte) Printf("%s", []byte("Go语言")) Go语言
%q 双引号围绕的字符串,由Go语法安全地转义 Printf("%q", "Go语言") "Go语言"
%x 十六进制,小写字母,每字节两个字符 Printf("%x", "golang") 676f6c616e67
%X 十六进制,大写字母,每字节两个字符 Printf("%X", "golang") 676F6C616E67
其它标记
占位符 说明 举例 输出
+ 总打印数值的正负号;对于%q(%+q)保证只输出ASCII编码的字符。
Printf("%+q", "中文") "\u4e2d\u6587"
- 在右侧而非左侧填充空格(左对齐该区域)
# 备用格式:为八进制添加前导 0(%#o) Printf("%#U", '中') U+4E2D
为十六进制添加前导 0x(%#x)或 0X(%#X),为 %p(%#p)去掉前导 0x;
如果可能的话,%q(%#q)会打印原始 (即反引号围绕的)字符串;
如果是可打印字符,%U(%#U)会写出该字符的
Unicode 编码形式(如字符 x 会被打印成 U+0078 'x')。
' ' (空格)为数值中省略的正负号留出空白(% d);
以十六进制(% x, % X)打印字符串或切片时,在字节之间用空格隔开
0 填充前导的0而非空格;对于数字,这会将填充移到正负号之后
func Rawurldecode ¶
https://www.php.net/manual/zh/function.rawurldecode.php rawurldecode()
func Rawurlencode ¶
https://www.php.net/manual/zh/function.rawurlencode.php rawurlencode()
func Realpath ¶
https://www.php.net/manual/zh/function.realpath.php realpath()
func Scandir ¶
https://www.php.net/manual/zh/function.scandir.php scandir()
func Sha1File ¶
https://www.php.net/manual/zh/function.sha1-file.php sha1_file
func Sin ¶
https://www.php.net/manual/zh/function.sin.php 正弦函数 x float64 度数
func Sinh ¶
https://www.php.net/manual/zh/function.sinh.php 双曲正弦 x float64 度数
func StrRepeat ¶
https://www.php.net/manual/zh/function.str-repeat.php str-repeat
func StrReplace ¶
https://www.php.net/manual/zh/function.str-replace.php str_replace
func StrShuffle ¶
https://www.php.net/manual/zh/function.str-shuffle.php str_shuffle
func StrSplit ¶
https://www.php.net/manual/zh/function.str-split.php str_split
func StrWordCount ¶
https://www.php.net/manual/zh/function.str-word-count.php str_word_count()
func Stripos ¶
https://www.php.net/manual/zh/function.stripos.php stripos 获取字符串首次出现的位置 不区分大小写
func Strpos ¶
https://www.php.net/manual/zh/function.strpos.php strpos 获取字符串首次出现的位置 区分大小写
func Strrev ¶
https://www.php.net/manual/zh/function.strrev.php strrev 反转字符串
func Strripos ¶
https://www.php.net/manual/zh/function.strripos.php strripos
func Strtolower ¶
https://www.php.net/manual/zh/function.strtolower.php strtolower
func Strtoupper ¶
https://www.php.net/manual/zh/function.strtoupper.php strtoupper
func Tan ¶
https://www.php.net/manual/zh/function.tan.php 正切 x float64 度数
func Ucfirst ¶
https://www.php.net/manual/zh/function.ucfirst.php ucfirst()
func Urldecode ¶
https://www.php.net/manual/zh/function.urldecode.php urldecode()
func Urlencode ¶
https://www.php.net/manual/zh/function.urlencode.php urlencode()
func VarDump ¶
func VarDump(v ...interface{})
https://www.php.net/manual/zh/function.var-dump.php var_dump()
Types ¶
type ArraySlice ¶
type ArraySlice []interface{}
func ArrayChunk ¶
func ArrayChunk(input ArraySlice, size int) ArraySlice
实现php中的array_chunk https://www.php.net/manual/zh/function.array-chunk.php todo 没有实现array_chunk第三个参数使用
Source Files
¶
- IsInt.go
- abs.go
- acos.go
- acosh.go
- array.go
- array_change_key_case.go
- array_chunk.go
- array_column.go
- array_combine.go
- array_count_values.go
- array_fill.go
- array_fill_keys.go
- array_flip.go
- array_key_exists.go
- array_keys.go
- array_map.go
- array_merge.go
- array_pop.go
- array_product.go
- array_push.go
- array_values.go
- array_walk.go
- asin.go
- asinh.go
- atan.go
- atan2.go
- atanh.go
- base64.go
- bindec.go
- ceil.go
- checkdate.go
- chgrp.go
- chmod.go
- chown.go
- chunk_split.go
- copy.go
- cos.go
- cosh.go
- date.go
- delete.go
- dirname.go
- echo.go
- empty.go
- explode.go
- file_get_contents.go
- file_put_contents.go
- get_hearders.go
- glob.go
- http_build_query.go
- implode.go
- is_bool.go
- is_dir.go
- is_double.go
- is_file.go
- is_float.go
- is_integer.go
- is_readable.go
- is_writable.go
- join.go
- lcfirst.go
- ltrim.go
- mb_strlen.go
- md5.go
- md5_file.go
- mkdir.go
- parse_url.go
- pi.go
- pow.go
- print.go
- print_r.go
- printf.go
- rawurldecode.go
- rawurlencode.go
- realpath.go
- rename.go
- rmdir.go
- rtrim.go
- scandir.go
- sha1.go
- sha1_file.go
- sin.go
- sinh.go
- sleep.go
- sort.go
- stat.go
- str_repeat.go
- str_shuffle.go
- str_split.go
- str_word_count.go
- stripos.go
- strlen.go
- strpos.go
- strrev.go
- strripos.go
- strrpos.go
- strstr.go
- strtolower.go
- strtoupper.go
- strtr.go
- substr.go
- substr_replace.go
- tan.go
- time.go
- trim.go
- ucfirst.go
- ucwords.go
- unlink.go
- urldecode.go
- urlencode.go
- usleep.go
- var_dump.go
- wordwrap.go
