{"id":20603589,"url":"https://github.com/kayw-geek/php-wordwrap","last_synced_at":"2026-04-22T10:30:59.696Z","repository":{"id":47980293,"uuid":"394919940","full_name":"kayw-geek/php-wordwrap","owner":"kayw-geek","description":"Word-wrapping for php","archived":false,"fork":false,"pushed_at":"2021-08-11T09:10:49.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T23:11:40.937Z","etag":null,"topics":["line","text","word","wordwrap","wrap"],"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/kayw-geek.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":"2021-08-11T08:33:38.000Z","updated_at":"2021-09-20T15:37:02.000Z","dependencies_parsed_at":"2022-08-12T15:50:32.440Z","dependency_job_id":null,"html_url":"https://github.com/kayw-geek/php-wordwrap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kayw-geek/php-wordwrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayw-geek%2Fphp-wordwrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayw-geek%2Fphp-wordwrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayw-geek%2Fphp-wordwrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayw-geek%2Fphp-wordwrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayw-geek","download_url":"https://codeload.github.com/kayw-geek/php-wordwrap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayw-geek%2Fphp-wordwrap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132015,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"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":["line","text","word","wordwrap","wrap"],"created_at":"2024-11-16T09:17:52.155Z","updated_at":"2026-04-22T10:30:59.681Z","avatar_url":"https://github.com/kayw-geek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP-WordWrap\n![GitHub](https://img.shields.io/github/license/kayw-geek/php-wordwrap)![php-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)![GitHub top language](https://img.shields.io/github/languages/top/kayw-geek/php-wordwrap)\n\nWord wrapping, with a few features.\n\n- force-break option\n- wraps hypenated words\n- multilingual - wraps any language that uses whitespace for word separation.\n- custom symbol wrap mode\n- chain call\n- multi-format return\n\n## Install\n\n ```shell\ncomposer require kayw-geek/php-wordwrap\n ```\n\n## Synopsis\n\nWrap some text in a 20 character column.\n\n```php\n\u003e $wrap = new \\KaywGeek\\WordWrap();\n\n\u003e $text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\";\n\n\u003e $result = $wrap-\u003etext($text)-\u003ewidth(20)-\u003ewrap();\n```\n\n`result` now looks like this:\n```\nLorem ipsum dolor\nsit amet,\nconsectetur\nadipiscing elit, sed\ndo eiusmod tempor\nincididunt ut labore\net dolore magna\naliqua.\n```\n\nBy default, long words will not break. Unless you set the `break` option.\n```php\n\u003e $text = \"https://github.com/kayw-geek/php-wordwrap\"\n\n\u003e $wrap-\u003etext($text)-\u003ewidth(28)-\u003ebreak(false)-\u003ewrap();\n  https://github.com/kayw-geek/php-wordwrap\n\n\u003e $wrap-\u003etext($text)-\u003ewidth(28)-\u003ebreak()-\u003ewrap();\n  https://github.com/kayw-geek\n  /php-wordwrap\n```\n\nPunctuation wrap mode\n\n```php\n\u003e $text = \"Of course,the first example appears to be the nicest one (or perhaps the fourth),but you may find that being able to use empty expressions in for loops comes in handy in many occasions.\";\n\n\n\u003e $wrap-\u003etext($text)-\u003elfEnable()-\u003ewrap();\n```\n\n`result`\n\n```\nOf course,\nthe first example appears to be the nicest one (or perhaps the fourth),\nbut you may find that being able to use empty expressions in for loops comes in handy in many occasions.\n```\n\nFormat data\n\n```php\n\u003e $text = \"Of course,the first example appears to be the nicest one (or perhaps the fourth),but you may find that being able to use empty expressions in for loops comes in handy in many occasions.\";\n\n/**\n* Format List\n* \\KaywGeek\\WordWrap::FORMAT_JSON\n* \\KaywGeek\\WordWrap::FORMAT_STRING\n* \\KaywGeek\\WordWrap::FORMAT_ARRAY\n*/\n\u003e $wrap-\u003etext($text)\n    -\u003elfEnable()\n    -\u003eresponseFormat(\\KaywGeek\\WordWrap::FORMAT_JSON)\n    -\u003ewrap();\n```\n\n## Inspiration\n\n[wordwrapjs](https://github.com/75lb/wordwrapjs)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayw-geek%2Fphp-wordwrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayw-geek%2Fphp-wordwrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayw-geek%2Fphp-wordwrap/lists"}