{"id":15024012,"url":"https://github.com/lasserafn/php-initials","last_synced_at":"2025-04-13T08:27:15.221Z","repository":{"id":57012634,"uuid":"81954635","full_name":"LasseRafn/php-initials","owner":"LasseRafn","description":"Library to generate initials from a full name. PHP 5.6+","archived":false,"fork":false,"pushed_at":"2024-08-23T17:07:40.000Z","size":51,"stargazers_count":41,"open_issues_count":2,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T00:11:35.646Z","etag":null,"topics":["initials","name","php","php56","php7"],"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/LasseRafn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-02-14T14:39:59.000Z","updated_at":"2024-08-23T17:07:43.000Z","dependencies_parsed_at":"2024-10-12T12:20:41.257Z","dependency_job_id":"8976b89c-562e-4804-a3fd-05d91114b4db","html_url":"https://github.com/LasseRafn/php-initials","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"d287e1542687390eb68de779949bc0adc49e2d52"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-initials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-initials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-initials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LasseRafn%2Fphp-initials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LasseRafn","download_url":"https://codeload.github.com/LasseRafn/php-initials/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248683268,"owners_count":21144877,"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":["initials","name","php","php56","php7"],"created_at":"2024-09-24T19:59:42.368Z","updated_at":"2025-04-13T08:27:15.182Z","avatar_url":"https://github.com/LasseRafn.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate initials from names\n\nThis is the core of [LasseRafn/php-initial-avatar-generator](http://github.com/LasseRafn/php-initial-avatar-generator), or well.. the initials generation part of it.\n\nIt's framework agnostic, which is different from basically everything else I do, you're welcome.\n\nSupports UTF8 (yes, also emojis.)\n \n\u003cp align=\"center\"\u003e \n\u003ca href=\"https://otterwise.app/github/lasserafn/php-initials\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https://otterwise.app/badge/github/lasserafn/php-initials/7357cbb2-0474-4291-ab99-16073228dccf\" alt=\"Code Coverage\"\u003e\u003c/a\u003e\n\u003ca href=\"https://styleci.io/repos/78973710\"\u003e\u003cimg src=\"https://styleci.io/repos/78973710/shield?branch=master\" alt=\"StyleCI Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/LasseRafn/php-initials\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/LasseRafn/php-initials.svg?style=flat-square\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/LasseRafn/php-initials\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/LasseRafn/php-initials.svg?style=flat-square\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/LasseRafn/php-initials\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/LasseRafn/php-initials.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Installation\n\nYou just require using composer and you're good to go!\n```bash\ncomposer require lasserafn/php-initials\n```\n\n## Usage\n\nAs with installation, usage is quite simple. Generating a image is done by running:\n\n```php\nuse LasseRafn\\Initials\\Initials;\n\necho (new Initials('Lasse Rafn'));                                   // Output: LR\necho (new Initials)-\u003ename('Justine Bieber')-\u003egenerate();             // Output: JB\necho (new Initials('John Christian Doe'))-\u003egenerate();               // Output: JD\necho (new Initials)-\u003egenerate('Leonardo');                           // Output: LE\necho (new Initials)-\u003elength(1)-\u003egenerate('Camilla');                 // Output: C\necho (new Initials)-\u003ename('Jens Ølsted')-\u003egetUrlfriendlyInitials();  // Output: JO\n```\n\nAll you'll have to do is either pass in the name in the constructor like so:\n\n```php\necho new Initials('The Name Here'); // TH\n```\n\nor use the `name($name)` method, to specify the name.\n\n\n## Supported methods\n\n### name($name = 'John Doe')\n\n```php\n$initials-\u003ename('Albert Magnum')-\u003egenerate();\n```\n\n### length($length = 2)\n\n```php\n$initials-\u003ename('Albert Magnum')-\u003elength(3)-\u003egenerate();\n```\n\n### generate()\n\nThis method will output the initials. It's completely optional, you could also just echo out the class as it has a `__toString()` method.\n\n```php\n$initials-\u003ename('Albert Magnum')-\u003egenerate();\n```\n\n### getUrlfriendlyInitials()\n\nWill output url-friendly initials (stripping characters like ÆØÅ)\n\n## Requirements\n* PHP 5.6, 7.0 or 7.1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasserafn%2Fphp-initials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flasserafn%2Fphp-initials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flasserafn%2Fphp-initials/lists"}