{"id":36736678,"url":"https://github.com/lihao1988/php2go","last_synced_at":"2026-01-12T12:22:09.199Z","repository":{"id":65732653,"uuid":"594648453","full_name":"lihao1988/php2go","owner":"lihao1988","description":"Implementing php functions with golang","archived":false,"fork":false,"pushed_at":"2023-02-11T13:46:22.000Z","size":22,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-19T18:12:04.336Z","etag":null,"topics":["go","php","php2go"],"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/lihao1988.png","metadata":{"files":{"readme":"README.en.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":"2023-01-29T07:37:55.000Z","updated_at":"2024-04-23T02:15:49.000Z","dependencies_parsed_at":"2023-02-19T14:45:39.028Z","dependency_job_id":null,"html_url":"https://github.com/lihao1988/php2go","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.1875,"last_synced_commit":"fbbb25b9944b5a4dc1eee311dff6de7f3b41705c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lihao1988/php2go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihao1988%2Fphp2go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihao1988%2Fphp2go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihao1988%2Fphp2go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihao1988%2Fphp2go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lihao1988","download_url":"https://codeload.github.com/lihao1988/php2go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lihao1988%2Fphp2go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","php","php2go"],"created_at":"2026-01-12T12:22:08.862Z","updated_at":"2026-01-12T12:22:09.193Z","avatar_url":"https://github.com/lihao1988.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php2go\n\n[![MIT licensed][3]][4]\n\n[3]: https://img.shields.io/badge/license-MIT-blue.svg\n[4]: LICENSE\n\n#### Introduce\nIn the process of PHP to Golang，realize functions that are used frequently in some PHP code, making it easier and faster for PHPer to transform into Gopher!\n\n#### README\n[README](https://github.com/lihao1988/php2go/blob/main/README.md)  \n[README-en](https://github.com/lihao1988/php2go/blob/main/README.en.md)\n\n#### Install\n```shell\n// github\ngo get github.com/lihao1988/php2go\n\n// gitee\ngo get gitee.com/lihao1988/php2go\n```\n\n## Requirements\nGo 1.15 or above.\n\n## PHP Function\n### Array(Slice/Map) Functions\n```php\n## import array\n\nIn()                   [PHP:in_array(),Checks if a value exists in an array]\nKeys()                 [PHP:array_keys(),Return all the keys or a subset of the keys of an array]\nValues()               [PHP:array_values(),Return all the values of an array]\nMerge()                [PHP:array_merge(),Merge one or more arrays]\nUnique()               [PHP:array_unique(),Removes duplicate values from an array]\nColumn()               [PHP:array_column(),Return the values from a single column in the input array]\nDiff()                 [PHP:array_diff(),Computes the difference of arrays]\nIntersect()            [PHP:array_intersect(),Computes the intersection of arrays]\n```\n### Crypto Functions\n```php\n## import crypto\n\nMD5()                  [PHP:md5(),Calculate the md5 hash of a string]\nSha1()                 [PHP:sha1(),Calculate the sha1 hash of a string]\nBase64Encode()         [PHP:base64_encode(),Encodes data with MIME base64]\nBase64Decode()         [PHP:base64_decode(),Decodes data encoded with MIME base64]\n```\n### Date/Time Functions\n```php\n## import datetime\n\nTime()                 [PHP:time(),Return current Unix timestamp]\nStrToTime()            [PHP:strtotime(),Parse about any English textual datetime description into a Unix timestamp]\nDate()                 [PHP:date(),Format a Unix timestamp]\nCheckDate()            [PHP:checkdate(),Validate a Gregorian date]\nSleep()                [PHP:sleep(),Delay execution]\nUsleep()               [PHP:usleep(),Delay execution in microseconds]\n```\n### Filesystem Functions\n```php\n## import file\n\nBasename()             [PHP:basename(),Returns trailing name component of path]\nDirname()              [PHP:dirname(),Returns a parent directory's path]\nFilesize()             [PHP:filesize(),Gets file size]\nPathInfo()             [PHP:pathinfo(),Returns information about a file path]\nFileExists()           [PHP:file_exists(),Checks whether a file or directory exists]\nIsDir()                [PHP:is_dir(),Tells whether the filename is a directory]\nIsFile()               [PHP:is_file(),Tells whether the filename is a regular file]\nFileGetContents()      [PHP:file_get_contents(),Reads entire file into a string]\nFilePutContents()      [PHP:file_put_contents(),Write data to a file]\nChmod()                [PHP:chmod(),Changes file mode]\nChown()                [PHP:chown(),Changes file owner]\n```\n### Math Functions\n```php\n## import math\n\nAbs()                  [PHP:abs(),Absolute value]\nRound()                [PHP:round(),Rounds a float]\nFloor()                [PHP:floor(),Round fractions down]\nCeil()                 [PHP:ceil(),Round fractions up]\nMax()                  [PHP:max(),Find highest value]\nMin()                  [PHP:min(),Find lowest value]\nDecBin()               [PHP:decbin(),Decimal to binary]\nDecHex()               [PHP:dechex(),Decimal to hexadecimal]\n```\n### String Functions\n```php\n## import string\n\nStrLen()               [PHP:strlen(),Get string length]\nMbStrLen()             [PHP:mb_strlen(),Get string length by UTF-8]\nSubstrCount()          [PHP:substr_count(),Count the number of substring occurrences]\nSubstr()               [PHP:substr(),Return part of a string]\nMbSubstr()             [PHP:mb_substr(),Get part of string by UTF-8]\nStrPos()               [PHP:strpos(),Find the position of the first occurrence of a substring in a string]\nStrRPos()              [PHP:strrpos(),Find the position of the last occurrence of a substring in a string]\nStrSplit()             [PHP:str_split(),Convert a string to an array]\nUCFirst()              [PHP:ucfirst(),Make a string's first character uppercase]\n```\n### URL Functions\n```php\n## import url\n\nParseUrl()             [PHP:parse_url(),Parse a URL and return its components]\nUrlEncode()            [PHP:urlencode(),URL-encodes string]\nUrlDecode()            [PHP:urldecode(),Decodes URL-encoded string]\nRawUrlEncode()         [PHP:rawurlencode(),URL-encode according to RFC 3986]\nRawUrlDecode()         [PHP:rawurldecode(),Decode URL-encoded strings]\nHttpBuildQuery()       [PHP:http_build_query(),Generate URL-encoded query string]\n```\n\n## LICENSE\nPHP2Go source code is licensed under the [MIT](https://github.com/lihao1988/php2go/blob/main/LICENSE) Licence.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flihao1988%2Fphp2go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flihao1988%2Fphp2go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flihao1988%2Fphp2go/lists"}