{"id":20052404,"url":"https://github.com/hyperjiang/php","last_synced_at":"2025-04-09T16:04:40.562Z","repository":{"id":57484647,"uuid":"115463624","full_name":"hyperjiang/php","owner":"hyperjiang","description":"Implements some PHP functions by Golang. This library has no third-party dependency.","archived":false,"fork":false,"pushed_at":"2024-11-05T02:13:10.000Z","size":207,"stargazers_count":54,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T16:04:35.259Z","etag":null,"topics":["golang","php"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hyperjiang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-27T00:00:14.000Z","updated_at":"2024-12-02T02:34:59.000Z","dependencies_parsed_at":"2024-12-18T05:16:50.787Z","dependency_job_id":null,"html_url":"https://github.com/hyperjiang/php","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjiang%2Fphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjiang%2Fphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjiang%2Fphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hyperjiang%2Fphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hyperjiang","download_url":"https://codeload.github.com/hyperjiang/php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065290,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","php"],"created_at":"2024-11-13T12:17:33.190Z","updated_at":"2025-04-09T16:04:40.544Z","avatar_url":"https://github.com/hyperjiang.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP functions implemented by Golang\n\n[![CI](https://github.com/hyperjiang/php/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/hyperjiang/php/actions/workflows/ci.yml)\n[![GoDoc](https://pkg.go.dev/badge/github.com/hyperjiang/php)](https://pkg.go.dev/github.com/hyperjiang/php)\n[![](https://goreportcard.com/badge/github.com/hyperjiang/php)](https://goreportcard.com/report/github.com/hyperjiang/php)\n[![codecov](https://codecov.io/gh/hyperjiang/php/branch/master/graph/badge.svg)](https://codecov.io/gh/hyperjiang/php)\n[![Release](https://img.shields.io/github/release/hyperjiang/php.svg)](https://github.com/hyperjiang/php/releases)\n\nThis package implements some PHP functions by Golang. Please note that it's impossible to have 100% the same behaviour between PHP and Golang functions because their mechanisms are quite different.\n\nMinimum go version requirement: `1.18`, if you are using lower version, please choose version `v0.63`.\n\n### Date/Time Functions\n\n| PHP function                             | Golang function                          |\n| ---------------------------------------- | ---------------------------------------- |\n| [checkdate](https://php.net/manual/en/function.checkdate.php) | [Checkdate](https://pkg.go.dev/github.com/hyperjiang/php#Checkdate) |\n| [date](https://php.net/manual/en/function.date.php) | [Date](https://pkg.go.dev/github.com/hyperjiang/php#Date) |\n| [strtotime](https://php.net/manual/en/function.strtotime.php) | [Strtotime](https://pkg.go.dev/github.com/hyperjiang/php#Strtotime) |\n| [time](https://php.net/manual/en/function.time.php) | [Time](https://pkg.go.dev/github.com/hyperjiang/php#Time) |\n| [microtime](https://php.net/manual/en/function.microtime.php) | [Microtime](https://pkg.go.dev/github.com/hyperjiang/php#Microtime) |\n| [date_add](https://www.php.net/manual/en/function.date-add.php) | [DateAdd](https://pkg.go.dev/github.com/hyperjiang/php#DateAdd) |\n| [date_create_from_format](https://www.php.net/manual/en/function.date-create-from-format.php) | [DateCreateFromFormat](https://pkg.go.dev/github.com/hyperjiang/php#DateCreateFromFormat) |\n| [date_create](https://www.php.net/manual/en/function.date-create.php) | [DateCreate](https://pkg.go.dev/github.com/hyperjiang/php#DateCreate) |\n| [date_date_set](https://www.php.net/manual/en/function.date-date-set.php) | [DateDateSet](https://pkg.go.dev/github.com/hyperjiang/php#DateDateSet) |\n| [date_default_timezone_get](https://www.php.net/manual/en/function.date-default-timezone-get.php) | [DateDefaultTimezoneGet](https://pkg.go.dev/github.com/hyperjiang/php#DateDefaultTimezoneGet) |\n| [date_default_timezone_set](https://www.php.net/manual/en/function.date-default-timezone-set.php) | [DateDefaultTimezoneSet](https://pkg.go.dev/github.com/hyperjiang/php#DateDefaultTimezoneSet) |\n| [date_diff](https://www.php.net/manual/en/function.date-diff.php) | [DateDiff](https://pkg.go.dev/github.com/hyperjiang/php#DateDiff) |\n| [date_format](https://www.php.net/manual/en/function.date-format.php) | [DateFormat](https://pkg.go.dev/github.com/hyperjiang/php#DateFormat) |\n| [date_interval_create_from_date_string](https://www.php.net/manual/en/function.date-interval-create-from-date-string.php) | [DateIntervalCreateFromDateString](https://pkg.go.dev/github.com/hyperjiang/php#DateIntervalCreateFromDateString) |\n| [date_isodate_set](https://www.php.net/manual/en/function.date-isodate-set.php) | [DateISODateSet](https://pkg.go.dev/github.com/hyperjiang/php#DateISODateSet) |\n| [date_modify](https://www.php.net/manual/en/function.date-modify.php) | [DateModify](https://pkg.go.dev/github.com/hyperjiang/php#DateModify) |\n| [date_offset_get](https://www.php.net/manual/en/function.date-offset-get.php) | [DateOffsetGet](https://pkg.go.dev/github.com/hyperjiang/php#DateOffsetGet) |\n| [date_sub](https://www.php.net/manual/en/function.date-sub.php) | [DateSub](https://pkg.go.dev/github.com/hyperjiang/php#DateSub) |\n| [date_timestamp_get](https://www.php.net/manual/en/function.date-timestamp-get.php) | [DateTimestampGet](https://pkg.go.dev/github.com/hyperjiang/php#DateTimestampGet) |\n| [date_timestamp_set](https://www.php.net/manual/en/function.date-timestamp-set.php) | [DateTimestampSet](https://pkg.go.dev/github.com/hyperjiang/php#DateTimestampSet) |\n| [date_timezone_get](https://www.php.net/manual/en/function.date-timezone-get.php) | [DateTimezoneGet](https://pkg.go.dev/github.com/hyperjiang/php#DateTimezoneGet) |\n| [date_timezone_set](https://www.php.net/manual/en/function.date-timezone-set.php) | [DateTimezoneSet](https://pkg.go.dev/github.com/hyperjiang/php#DateTimezoneSet) |\n\n### String Functions\n\n| PHP function                             | Golang function                          |\n| ---------------------------------------- | ---------------------------------------- |\n| [addslashes](https://php.net/manual/en/function.addslashes.php) | [Addslashes](https://pkg.go.dev/github.com/hyperjiang/php#Addslashes) |\n| [chr](https://php.net/manual/en/function.chr.php) | [Chr](https://pkg.go.dev/github.com/hyperjiang/php#Chr) |\n| [crc32](https://php.net/manual/en/function.crc32.php) | [Crc32](https://pkg.go.dev/github.com/hyperjiang/php#Crc32) |\n| [explode](https://php.net/manual/en/function.explode.php) | [Explode](https://pkg.go.dev/github.com/hyperjiang/php#Explode) |\n| [bin2hex](https://php.net/manual/en/function.bin2hex.php) | [Bin2hex](https://pkg.go.dev/github.com/hyperjiang/php#Bin2hex) |\n| [hex2bin](https://php.net/manual/en/function.hex2bin.php) | [Hex2bin](https://pkg.go.dev/github.com/hyperjiang/php#Hex2bin) |\n| [htmlspecialchars](https://php.net/manual/en/function.htmlspecialchars.php) | [HTMLSpecialchars](https://pkg.go.dev/github.com/hyperjiang/php#HTMLSpecialchars) |\n| [htmlspecialchars_decode](https://php.net/manual/en/function.htmlspecialchars-decode.php) | [HTMLSpecialcharsDecode](https://pkg.go.dev/github.com/hyperjiang/php#HTMLSpecialcharsDecode) |\n| [implode](https://php.net/manual/en/function.implode.php) | [Implode](https://pkg.go.dev/github.com/hyperjiang/php#Implode) |\n| [str_ireplace](https://php.net/manual/en/function.str-ireplace.php) | [Ireplace](https://pkg.go.dev/github.com/hyperjiang/php#Ireplace) |\n| [lcfirst](https://php.net/manual/en/function.lcfirst.php) | [Lcfirst](https://pkg.go.dev/github.com/hyperjiang/php#Lcfirst) |\n| [md5](https://php.net/manual/en/function.md5.php) | [Md5](https://pkg.go.dev/github.com/hyperjiang/php#Md5) |\n| [md5_file](https://php.net/manual/en/function.md5-file.php) | [Md5File](https://pkg.go.dev/github.com/hyperjiang/php#Md5File) |\n| [sha1](https://php.net/manual/en/function.sha1.php) | [Sha1](https://pkg.go.dev/github.com/hyperjiang/php#Sha1) |\n| [sha1_file](https://php.net/manual/en/function.sha1-file.php) | [Sha1File](https://pkg.go.dev/github.com/hyperjiang/php#Sha1File) |\n| [number_format](https://php.net/manual/en/function.number-format.php) | [NumberFormat](https://pkg.go.dev/github.com/hyperjiang/php#NumberFormat) |\n| [ord](https://php.net/manual/en/function.ord.php) | [Ord](https://pkg.go.dev/github.com/hyperjiang/php#Ord) |\n| [str_replace](https://php.net/manual/en/function.str-replace.php) | [Replace](https://pkg.go.dev/github.com/hyperjiang/php#Replace) |\n| [similar_text](https://php.net/manual/en/function.similar-text.php) | [SimilarText](https://pkg.go.dev/github.com/hyperjiang/php#SimilarText) |\n| [stripslashes](https://php.net/manual/en/function.stripslashes.php) | [Stripslashes](https://pkg.go.dev/github.com/hyperjiang/php#Stripslashes) |\n| [mb_stripos](https://php.net/manual/en/function.mb-stripos.php) | [Stripos](https://pkg.go.dev/github.com/hyperjiang/php#Stripos) |\n| [mb_stristr](https://php.net/manual/en/function.mb-stristr.php) | [Stristr](https://pkg.go.dev/github.com/hyperjiang/php#Stristr) |\n| [mb_strlen](https://php.net/manual/en/function.mb-strlen.php) | [Strlen](https://pkg.go.dev/github.com/hyperjiang/php#Strlen) |\n| [mb_strpos](https://php.net/manual/en/function.mb-strpos.php) | [Strpos](https://pkg.go.dev/github.com/hyperjiang/php#Strpos) |\n| [mb_strripos](https://php.net/manual/en/function.mb-strripos.php) | [Strripos](https://pkg.go.dev/github.com/hyperjiang/php#Strripos) |\n| [mb_strrpos](https://php.net/manual/en/function.mb-strrpos.php) | [Strrpos](https://pkg.go.dev/github.com/hyperjiang/php#Strrpos) |\n| [mb_strstr](https://php.net/manual/en/function.mb-strstr.php) | [Strstr](https://pkg.go.dev/github.com/hyperjiang/php#Strstr) |\n| [mb_substr](https://php.net/manual/en/function.mb-substr.php) | [Substr](https://pkg.go.dev/github.com/hyperjiang/php#Substr) |\n| [str_pad](https://php.net/manual/en/function.str-pad.php) | [StrPad](https://pkg.go.dev/github.com/hyperjiang/php#StrPad) |\n| [str_repeat](https://php.net/manual/en/function.str-repeat.php) | [StrRepeat](https://pkg.go.dev/github.com/hyperjiang/php#StrRepeat) |\n| [strrev](https://php.net/manual/en/function.strrev.php) | [Strrev](https://pkg.go.dev/github.com/hyperjiang/php#Strrev) |\n| [strtolower](https://php.net/manual/en/function.strtolower.php) | [Strtolower](https://pkg.go.dev/github.com/hyperjiang/php#Strtolower) |\n| [strtoupper](https://php.net/manual/en/function.strtoupper.php) | [Strtoupper](https://pkg.go.dev/github.com/hyperjiang/php#Strtoupper) |\n| [str_word_count](https://php.net/manual/en/function.str-word-count.php) | [StrWordCount](https://pkg.go.dev/github.com/hyperjiang/php#StrWordCount) |\n| [ltrim](https://php.net/manual/en/function.ltrim.php) | [Ltrim](https://pkg.go.dev/github.com/hyperjiang/php#Ltrim) |\n| [rtrim](https://php.net/manual/en/function.rtrim.php) | [Rtrim](https://pkg.go.dev/github.com/hyperjiang/php#Rtrim) |\n| [trim](https://php.net/manual/en/function.trim.php) | [Trim](https://pkg.go.dev/github.com/hyperjiang/php#Trim) |\n| [ucfirst](https://php.net/manual/en/function.ucfirst.php) | [Ucfirst](https://pkg.go.dev/github.com/hyperjiang/php#Ucfirst) |\n| [ucwords](https://php.net/manual/en/function.ucwords.php) | [Ucwords](https://pkg.go.dev/github.com/hyperjiang/php#Ucwords) |\n\n### Math Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [abs](https://php.net/manual/en/function.abs.php) | [Abs](https://pkg.go.dev/github.com/hyperjiang/php#Abs) |\n| [base_convert](https://php.net/manual/en/function.base-convert.php) | [BaseConvert](https://pkg.go.dev/github.com/hyperjiang/php#BaseConvert) |\n| [bindec](https://php.net/manual/en/function.bindec.php) | [Bindec](https://pkg.go.dev/github.com/hyperjiang/php#Bindec) |\n| [decbin](https://php.net/manual/en/function.decbin.php) | [Decbin](https://pkg.go.dev/github.com/hyperjiang/php#Decbin) |\n| [dechex](https://php.net/manual/en/function.dechex.php) | [Dechex](https://pkg.go.dev/github.com/hyperjiang/php#Dechex) |\n| [hexdec](https://php.net/manual/en/function.hexdec.php) | [Hexdec](https://pkg.go.dev/github.com/hyperjiang/php#Hexdec) |\n| [decoct](https://php.net/manual/en/function.decoct.php) | [Decoct](https://pkg.go.dev/github.com/hyperjiang/php#Decoct) |\n| [octdec](https://php.net/manual/en/function.octdec.php) | [Octdec](https://pkg.go.dev/github.com/hyperjiang/php#Octdec) |\n| [ceil](https://php.net/manual/en/function.ceil.php) | [Ceil](https://pkg.go.dev/github.com/hyperjiang/php#Ceil) |\n| [floor](https://php.net/manual/en/function.floor.php) | [Floor](https://pkg.go.dev/github.com/hyperjiang/php#Floor) |\n| [pi](https://php.net/manual/en/function.pi.php) | [Pi](https://pkg.go.dev/github.com/hyperjiang/php#Pi) |\n| [mt_rand](https://php.net/manual/en/function.mt-rand.php) | [MtRand](https://pkg.go.dev/github.com/hyperjiang/php#MtRand) |\n| [rand](https://php.net/manual/en/function.rand.php) | [Rand](https://pkg.go.dev/github.com/hyperjiang/php#Rand) |\n| [round](https://php.net/manual/en/function.round.php) | [Round](https://pkg.go.dev/github.com/hyperjiang/php#Round) |\n\n### Array Functions\n\n| PHP function                                                 | Golang function                                              |\n| ------------------------------------------------------------ | ------------------------------------------------------------ |\n| [array_chunk](https://php.net/manual/en/function.array-chunk.php) | [ArrayChunk](https://pkg.go.dev/github.com/hyperjiang/php#ArrayChunk) |\n| [array_column](https://php.net/manual/en/function.array-column.php) | [ArrayColumn](https://pkg.go.dev/github.com/hyperjiang/php#ArrayColumn) |\n| [array_combine](https://php.net/manual/en/function.array-combine.php) | [ArrayCombine](https://pkg.go.dev/github.com/hyperjiang/php#ArrayCombine) |\n| [array_diff](https://php.net/manual/en/function.array-diff.php) | [ArrayDiff](https://pkg.go.dev/github.com/hyperjiang/php#ArrayDiff) |\n| [array_filter](https://php.net/manual/en/function.array-filter.php) | [ArrayFilter](https://pkg.go.dev/github.com/hyperjiang/php#ArrayFilter) |\n| [array_flip](https://php.net/manual/en/function.array-flip.php) | [ArrayFlip](https://pkg.go.dev/github.com/hyperjiang/php#ArrayFlip) |\n| [array_intersect](https://php.net/manual/en/function.array-intersect.php) | [ArrayIntersect](https://pkg.go.dev/github.com/hyperjiang/php#ArrayIntersect) |\n| [array_keys](https://php.net/manual/en/function.array-keys.php) | [ArrayKeys](https://pkg.go.dev/github.com/hyperjiang/php#ArrayKeys) |\n| [array_key_exists](https://www.php.net/manual/en/function.array-key-exists.php) | [ArrayKeyExists](https://pkg.go.dev/github.com/hyperjiang/php#ArrayKeyExists) |\n| [array_pad](https://php.net/manual/en/function.array-pad.php) | [ArrayPad](https://pkg.go.dev/github.com/hyperjiang/php#ArrayPad) |\n| [array_pop](https://php.net/manual/en/function.array-pop.php) | [ArrayPop](https://pkg.go.dev/github.com/hyperjiang/php#ArrayPop) |\n| [array_push](https://php.net/manual/en/function.array-push.php) | [ArrayPush](https://pkg.go.dev/github.com/hyperjiang/php#ArrayPush) |\n| [array_reverse](https://php.net/manual/en/function.array-reverse.php) | [ArraySlice](https://pkg.go.dev/github.com/hyperjiang/php#ArraySlice) |\n| [array_slice](https://php.net/manual/en/function.array-slice.php) | [ArrayReverse](https://pkg.go.dev/github.com/hyperjiang/php#ArrayReverse) |\n| [array_sum](https://php.net/manual/en/function.array-sum.php) | [ArraySum](https://pkg.go.dev/github.com/hyperjiang/php#ArraySum) |\n| [array_shift](https://php.net/manual/en/function.array-shift.php) | [ArrayShift](https://pkg.go.dev/github.com/hyperjiang/php#ArrayShift) |\n| [array_unshift](https://php.net/manual/en/function.array-unshift.php) | [ArrayUnshift](https://pkg.go.dev/github.com/hyperjiang/php#ArrayUnshift) |\n| [array_unique](https://php.net/manual/en/function.array-unique.php) | [ArrayUnique](https://pkg.go.dev/github.com/hyperjiang/php#ArrayUnique) |\n| [count](https://php.net/manual/en/function.count.php) | [Count](https://pkg.go.dev/github.com/hyperjiang/php#Count) |\n| [in_array](https://php.net/manual/en/function.in-array.php) | [InArray](https://pkg.go.dev/github.com/hyperjiang/php#InArray) |\n| [key_exists](https://www.php.net/manual/en/function.key-exists.php) | [KeyExists](https://pkg.go.dev/github.com/hyperjiang/php#KeyExists) |\n| [sort](https://php.net/manual/en/function.sort.php) | [Sort](https://pkg.go.dev/github.com/hyperjiang/php#Sort) |\n| [rsort](https://php.net/manual/en/function.rsort.php) | [Rsort](https://pkg.go.dev/github.com/hyperjiang/php#Rsort) |\n\n### Ctype Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [ctype_alnum](https://php.net/manual/en/function.ctype-alnum.php) | [CtypeAlnum](https://pkg.go.dev/github.com/hyperjiang/php#CtypeAlnum) |\n| [ctype_alpha](https://php.net/manual/en/function.ctype-alpha.php) | [CtypeAlpha](https://pkg.go.dev/github.com/hyperjiang/php#CtypeAlpha) |\n| [ctype_cntrl](https://php.net/manual/en/function.ctype-cntrl.php) | [CtypeCntrl](https://pkg.go.dev/github.com/hyperjiang/php#CtypeCntrl) |\n| [ctype_digit](https://php.net/manual/en/function.ctype-digit.php) | [CtypeDigit](https://pkg.go.dev/github.com/hyperjiang/php#CtypeDigit) |\n| [ctype_graph](https://php.net/manual/en/function.ctype-graph.php) | [CtypeGraph](https://pkg.go.dev/github.com/hyperjiang/php#CtypeGraph) |\n| [ctype_lower](https://php.net/manual/en/function.ctype-lower.php) | [CtypeLower](https://pkg.go.dev/github.com/hyperjiang/php#CtypeLower) |\n| [ctype_print](https://php.net/manual/en/function.ctype-print.php) | [CtypePrint](https://pkg.go.dev/github.com/hyperjiang/php#CtypePrint) |\n| [ctype_punct](https://php.net/manual/en/function.ctype-punct.php) | [CtypePunct](https://pkg.go.dev/github.com/hyperjiang/php#CtypePunct) |\n| [ctype_space](https://php.net/manual/en/function.ctype-space.php) | [CtypeSpace](https://pkg.go.dev/github.com/hyperjiang/php#CtypeSpace) |\n| [ctype_upper](https://php.net/manual/en/function.ctype-upper.php) | [CtypeUpper](https://pkg.go.dev/github.com/hyperjiang/php#CtypeUpper) |\n| [ctype_xdigit](https://php.net/manual/en/function.ctype-xdigit.php) | [CtypeXdigit](https://pkg.go.dev/github.com/hyperjiang/php#CtypeXdigit) |\n\n### Filesystem Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [basename](https://www.php.net/manual/en/function.basename.php) | [Basename](https://pkg.go.dev/github.com/hyperjiang/php#Basename) |\n| [dirname](https://www.php.net/manual/en/function.dirname.php) | [Dirname](https://pkg.go.dev/github.com/hyperjiang/php#Dirname) [DirnameWithLevels](https://pkg.go.dev/github.com/hyperjiang/php#DirnameWithLevels) |\n| [realpath](https://www.php.net/manual/en/function.realpath.php) | [Realpath](https://pkg.go.dev/github.com/hyperjiang/php#realpath) |\n| [touch](https://www.php.net/manual/en/function.touch.php) | [Touch](https://pkg.go.dev/github.com/hyperjiang/php#Touch) |\n| [unlink](https://www.php.net/manual/en/function.unlink.php) | [Unlink](https://pkg.go.dev/github.com/hyperjiang/php#Unlink) |\n| [mkdir](https://www.php.net/manual/en/function.mkdir.php) | [Mkdir](https://pkg.go.dev/github.com/hyperjiang/php#Mkdir) |\n| [rmdir](https://www.php.net/manual/en/function.rmdir.php) | [Rmdir](https://pkg.go.dev/github.com/hyperjiang/php#Rmdir) |\n| [symlink](https://www.php.net/manual/en/function.symlink.php) | [Symlink](https://pkg.go.dev/github.com/hyperjiang/php#Symlink) |\n| [link](https://www.php.net/manual/en/function.link.php) | [Link](https://pkg.go.dev/github.com/hyperjiang/php#Link) |\n| [chmod](https://www.php.net/manual/en/function.chmod.php) | [Chmod](https://pkg.go.dev/github.com/hyperjiang/php#Chmod) |\n| [chown](https://www.php.net/manual/en/function.chown.php) | [Chown](https://pkg.go.dev/github.com/hyperjiang/php#Chown) |\n| [is_file](https://www.php.net/manual/en/function.is-file.php) | [IsFile](https://pkg.go.dev/github.com/hyperjiang/php#IsFile) |\n| [is_dir](https://www.php.net/manual/en/function.is-dir.php) | [IsDir](https://pkg.go.dev/github.com/hyperjiang/php#IsDir) |\n| [is_executable](https://www.php.net/manual/en/function.is-executable.php) | [IsExecutable](https://pkg.go.dev/github.com/hyperjiang/php#IsExecutable) |\n| [is_readable](https://www.php.net/manual/en/function.is-readable.php) | [IsReadable](https://pkg.go.dev/github.com/hyperjiang/php#IsReadable) |\n| [is_writable](https://www.php.net/manual/en/function.is-writable.php) | [IsWritable](https://pkg.go.dev/github.com/hyperjiang/php#IsWritable) |\n| [is_link](https://www.php.net/manual/en/function.is-link.php) | [IsLink](https://pkg.go.dev/github.com/hyperjiang/php#IsLink) |\n| [file_exists](https://www.php.net/manual/en/function.file-exists.php) | [FileExists](https://pkg.go.dev/github.com/hyperjiang/php#FileExists) |\n| [filesize](https://www.php.net/manual/en/function.filesize.php) | [Filesize](https://pkg.go.dev/github.com/hyperjiang/php#Filesize) |\n| [copy](https://www.php.net/manual/en/function.copy.php) | [Copy](https://pkg.go.dev/github.com/hyperjiang/php#Copy) |\n| [rename](https://www.php.net/manual/en/function.rename.php) | [Rename](https://pkg.go.dev/github.com/hyperjiang/php#Rename) |\n| [file_get_contents](https://www.php.net/manual/en/function.file-get-contents.php) | [FileGetContents](https://pkg.go.dev/github.com/hyperjiang/php#FileGetContents) |\n| [file_put_contents](https://www.php.net/manual/en/function.file-put-contents.php) | [FilePutContents](https://pkg.go.dev/github.com/hyperjiang/php#FilePutContents) |\n\n### Directory Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [getcwd](https://www.php.net/manual/en/function.getcwd.php) | [Getcwd](https://pkg.go.dev/github.com/hyperjiang/php#Getcwd) |\n| [chdir](https://www.php.net/manual/en/function.chdir.php) | [Chdir](https://pkg.go.dev/github.com/hyperjiang/php#Chdir) |\n| [scandir](https://www.php.net/manual/en/function.scandir.php) | [Scandir](https://pkg.go.dev/github.com/hyperjiang/php#Scandir) |\n\n### Image Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [getimagesize](https://www.php.net/manual/en/function.getimagesize.php) | [GetImageSize](https://pkg.go.dev/github.com/hyperjiang/php#GetImageSize) |\n| [getimagesizefromstring](https://www.php.net/manual/en/function.getimagesizefromstring.php) | [GetImageSizeFromString](https://pkg.go.dev/github.com/hyperjiang/php#GetImageSizeFromString) |\n\n### Network Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [gethostbyaddr](https://php.net/manual/en/function.gethostbyaddr.php) | [GetHostByAddr](https://pkg.go.dev/github.com/hyperjiang/php#GetHostByAddr) |\n| [gethostbyname](https://php.net/manual/en/function.gethostbyname.php) | [GetHostByName](https://pkg.go.dev/github.com/hyperjiang/php#GetHostByName) |\n| [gethostbynamel](https://php.net/manual/en/function.gethostbynamel.php) | [GetHostByNamel](https://pkg.go.dev/github.com/hyperjiang/php#GetHostByNamel) |\n| [gethostname](https://php.net/manual/en/function.gethostname.php) | [GetHostName](https://pkg.go.dev/github.com/hyperjiang/php#GetHostName) |\n| [ip2long](https://php.net/manual/en/function.ip2long.php) | [IP2Long](https://pkg.go.dev/github.com/hyperjiang/php#IP2Long) |\n| [long2ip](https://php.net/manual/en/function.long2ip.php) | [Long2IP](https://pkg.go.dev/github.com/hyperjiang/php#Long2IP) |\n\n### JSON Functions\n\n| PHP function                             | Golang function                          |\n| ---------------------------------------- | ---------------------------------------- |\n| [json_decode](https://php.net/manual/en/function.json-decode.php) | [JSONDecode](https://pkg.go.dev/github.com/hyperjiang/php#JSONDecode) |\n| [json_encode](https://php.net/manual/en/function.json-encode.php) | [JSONEncode](https://pkg.go.dev/github.com/hyperjiang/php#JSONEncode) |\n\n### CSPRNG Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [random_bytes](https://php.net/manual/en/function.random-bytes.php) | [RandomBytes](https://pkg.go.dev/github.com/hyperjiang/php#RandomBytes) |\n\n### URL Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [base64_decode](https://www.php.net/manual/en/function.base64-decode.php) | [Base64Decode](https://pkg.go.dev/github.com/hyperjiang/php#Base64Decode) |\n| [base64_encode](https://www.php.net/manual/en/function.base64-encode.php) | [Base64Encode](https://pkg.go.dev/github.com/hyperjiang/php#Base64Encode) |\n| [get_headers](https://www.php.net/manual/en/function.get-headers.php) | [GetHeaders](https://pkg.go.dev/github.com/hyperjiang/php#GetHeaders) |\n| [get_meta_tags](https://www.php.net/manual/en/function.get-meta-tags.php) | [GetMetaTags](https://pkg.go.dev/github.com/hyperjiang/php#GetMetaTags) |\n| [http_build_query](https://www.php.net/manual/en/function.http-build-query.php) | [HTTPBuildQuery](https://pkg.go.dev/github.com/hyperjiang/php#HTTPBuildQuery) |\n| [parse_url](https://www.php.net/manual/en/function.parse-url.php) | [ParseURL](https://pkg.go.dev/github.com/hyperjiang/php#ParseURL) |\n| [rawurldecode](https://www.php.net/manual/en/function.rawurldecode.php) | [RawURLDecode](https://pkg.go.dev/github.com/hyperjiang/php#RawURLDecode) |\n| [rawurlencode](https://www.php.net/manual/en/function.rawurlencode.php) | [RawURLEncode](https://pkg.go.dev/github.com/hyperjiang/php#RawURLEncode) |\n| [urldecode](https://www.php.net/manual/en/function.urldecode.php) | [URLDecode](https://pkg.go.dev/github.com/hyperjiang/php#URLDecode) |\n| [urlencode](https://www.php.net/manual/en/function.urlencode.php) | [URLEncode](https://pkg.go.dev/github.com/hyperjiang/php#URLEncode) |\n\n### Misc Functions\n\n| PHP function                                         | Golang function                                            |\n| ---------------------------------------------------- | ---------------------------------------------------------- |\n| [getenv](https://php.net/manual/en/function.getenv.php) | [Getenv](https://pkg.go.dev/github.com/hyperjiang/php#Getenv) |\n| [putenv](https://php.net/manual/en/function.putenv.php) | [Putenv](https://pkg.go.dev/github.com/hyperjiang/php#Putenv) |\n| [memory_get_usage](https://php.net/manual/en/function.memory-get-usage.php) | [MemoryGetUsage](https://pkg.go.dev/github.com/hyperjiang/php#MemoryGetUsage) |\n\n## Install\n\n```\ngo get github.com/hyperjiang/php\n```\n\n## Usage\n\n```\nimport (\n    \"fmt\"\n    \"github.com/hyperjiang/php\"\n)\n\n// Date/Time functions\n\nfmt.Println(php.Strtotime(\"2017-07-14 02:40:00\")) // output: 1500000000\n\nfmt.Println(php.Strtotime(\"2017-07-14T10:40:00+08:00\")) // output: 1500000000\n\nfmt.Println(php.Date(\"Y-m-d H:i:s\", 1500000000)) // output: 2017-07-14 02:40:00\n\nfmt.Println(php.Date(\"c\", 1500000000)) // output: 2017-07-14T02:40:00+00:00\n\n// String functions\n\nstr := \"abcdef\"\n\nfmt.Println(php.Substr(str, 1, 0)) // bcdef\nfmt.Println(php.Substr(str, 1, 3)) // bcd\nfmt.Println(php.Substr(str, 0, 4)) // abcd\nfmt.Println(php.Substr(str, -1, 1)) // f\nfmt.Println(php.Substr(str, 0, -1)) // abcde\n\n// Math functions\n\nfmt.Println(php.Round(5.055, 2)) // 5.06\n\n// Array functions\n\narr := []string{\"1\", \"1\", \"2\", \"3\", \"a\", \"ab\", \"abc\", \"abc\", \"abc\", \"Abc\"}\nfmt.Println(php.ArrayUnique(arr)) // [abc Abc 1 2 3 a ab]\nfmt.Println(php.InArray(\"a\", arr)) // true\n\n```\n\n*For more usage you can find it out from test files.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjiang%2Fphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhyperjiang%2Fphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhyperjiang%2Fphp/lists"}