{"id":42204502,"url":"https://github.com/friendsofthinkphp/think-pinyin","last_synced_at":"2026-01-27T00:31:29.385Z","repository":{"id":57083988,"uuid":"200974745","full_name":"friendsofthinkphp/think-pinyin","owner":"friendsofthinkphp","description":"ThinkPHP 中文转拼音扩展包","archived":false,"fork":false,"pushed_at":"2023-02-17T01:20:38.000Z","size":18,"stargazers_count":33,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-09T15:22:15.059Z","etag":null,"topics":["thinkphp","thinkphp-extend"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/friendsofthinkphp.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}},"created_at":"2019-08-07T04:54:31.000Z","updated_at":"2023-09-28T05:22:59.000Z","dependencies_parsed_at":"2022-08-24T14:59:09.601Z","dependency_job_id":null,"html_url":"https://github.com/friendsofthinkphp/think-pinyin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/friendsofthinkphp/think-pinyin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendsofthinkphp%2Fthink-pinyin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendsofthinkphp%2Fthink-pinyin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendsofthinkphp%2Fthink-pinyin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendsofthinkphp%2Fthink-pinyin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friendsofthinkphp","download_url":"https://codeload.github.com/friendsofthinkphp/think-pinyin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendsofthinkphp%2Fthink-pinyin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28793339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: 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":["thinkphp","thinkphp-extend"],"created_at":"2026-01-27T00:31:28.851Z","updated_at":"2026-01-27T00:31:29.372Z","avatar_url":"https://github.com/friendsofthinkphp.png","language":"PHP","readme":"# ThinkPHP-Pinyin\nThinkPHP版 中文转拼音扩展包 支持ThinkPHP `5.1` `6.0`版本\n\n## 安装\n```sh\ncomposer require \"xiaodi/think-pinyin\"\n```\n**使用包**\n* [overtrue/pinyin](https://github.com/overtrue/pinyin) `安正超`\n\n## 快捷使用\n\n|  助手函数      | 方法调用                                                |\n| -------------  | --------------------------------------------------- |\n| `pinyin()`     | `app('pinyin')-\u003econvert()`                              |\n| `pinyin_abbr()`     | `app('pinyin')-\u003eabbr()`                                        |\n| `pinyin_permalink()` | `app('pinyin')-\u003epermalink()`                         |\n| `pinyin_sentence()` | `app('pinyin')-\u003esentence()`                         |\n\n```php\nvar_dump(pinyin('带着希望去旅行，比到达终点更美好'));\n// [\"dai\", \"zhe\", \"xi\", \"wang\", \"qu\", \"lv\", \"xing\", \"bi\", \"dao\", \"da\", \"zhong\", \"dian\", \"geng\", \"mei\", \"hao\"]\n\nvar_dump(pinyin_abbr('带着希望去旅行，比到达终点更美好'));\n// dzxwqlxbddzdgmh\n\nvar_dump(pinyin_permalink('带着希望去旅行，比到达终点更美好'))\n// dai-zhe-xi-wang-qu-lyu-xing-bi-dao-da-zhong-dian-geng-mei-hao\n\nvar_dump(pinyin_sentence('带着希望去旅行，比到达终点更美好'))\n// daizhexiwangqulyuxing,bidaodazhongdiangengmeihao\n```\n\n## 门面调用\n```php\nuse xiaodi\\ThinkPinyin\\Pinyin;\n\nPinyin::convert();\nPinyin::abbr();\nPinyin::permalink();\nPinyin::sentence();\n```\n\n## 控制器调用\n\n### 5.1\n```php\nuse think\\Controller;\n\nclass Index extends Controller\n{\n  $this-\u003eapp-\u003epinyin-\u003econvert('带着希望去旅行，比到达终点更美好');\n}\n\n```\n\n### 6.0\n```php\nuse app\\BaseController\n\nclass Index extends BaseController\n{\n  $this-\u003eapp-\u003epinyin-\u003econvert('带着希望去旅行，比到达终点更美好');\n}\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofthinkphp%2Fthink-pinyin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendsofthinkphp%2Fthink-pinyin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendsofthinkphp%2Fthink-pinyin/lists"}