{"id":18659185,"url":"https://github.com/fnayou/dotted","last_synced_at":"2025-04-11T20:30:53.181Z","repository":{"id":62506069,"uuid":"94787154","full_name":"fnayou/dotted","owner":"fnayou","description":"php library to access multidimensional arrays","archived":false,"fork":false,"pushed_at":"2022-10-30T19:45:08.000Z","size":29,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T13:46:41.806Z","etag":null,"topics":["array","library","multidimensional","php"],"latest_commit_sha":null,"homepage":"https://github.com/fnayou/dotted","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/fnayou.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}},"created_at":"2017-06-19T14:43:01.000Z","updated_at":"2023-08-21T11:41:13.000Z","dependencies_parsed_at":"2022-11-02T12:16:52.174Z","dependency_job_id":null,"html_url":"https://github.com/fnayou/dotted","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnayou%2Fdotted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnayou%2Fdotted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnayou%2Fdotted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnayou%2Fdotted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnayou","download_url":"https://codeload.github.com/fnayou/dotted/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223478336,"owners_count":17151843,"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":["array","library","multidimensional","php"],"created_at":"2024-11-07T07:36:12.592Z","updated_at":"2024-11-07T07:36:13.086Z","avatar_url":"https://github.com/fnayou.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dotted\n======\n\n\u003cimg src=\"https://cloud.aymen.fr/s/bqQjwjFrjQ2JtCQ/download\" width=\"120px\" align=\"left\"/\u003e\n\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/fnayou/dotted/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fnayou/dotted/?branch=master)\n[![Version](http://img.shields.io/packagist/v/fnayou/dotted.svg?style=flat)](https://packagist.org/packages/fnayou/dotted)\n[![Build Status](https://drone.aymen.fr/api/badges/fnayou/dotted/status.svg)](https://drone.aymen.fr/fnayou/dotted)\n\n**Dotted** is a PHP library to manage *multidimensional arrays* !\n\nIt will help you *checking*, *accessing* or *inserting* values of an array.\n\n## Installation\n\nuse [Composer][link-composer] to install `dotted` library :\n\n```shell\n$ php composer.phar require fnayou/dotted\n```\n\nor [download the latest release][link-release] and include `src/Dotted.php` in your project.\n\n## Compatibility\n\nafter the last changes. **Dotted** is only compatible with `\u003e= PHP 7.4`\nfor older versions, please use tag `1.x.x`\n\n## Usage\n\nfirst, you create `dotted` object by passing the `array` content.\n\nnext you can *check*, *access* or *insert* values with ease.\n\n```php\n\u003c?php\n\n    use Fnayou\\Dotted;\n\n    $content = [\n        'keyOne' =\u003e 'valueOne',\n        'keyTwo' =\u003e [\n            'keyThree' =\u003e 3,\n            'keyFour' =\u003e false,\n            'keyFive' =\u003e [\n                true,\n                'valueFive',\n                5,\n            ]\n        ]\n    ];\n\n    $dotted = new Dotted($content);\n    // or\n    $dotted = Dotted::create($content);\n\n    // check if values exist\n    echo $dotted-\u003ehas('keyOne');                        // output : true\n    echo $dotted-\u003ehas('keyTwo.keySix');                 // output : false\n\n    // access values\n    echo $dotted-\u003eget('keyOne');                        // output : valueOne\n    echo $dotted-\u003eget('keyTwo.keyThree');               // output : 3\n    echo $dotted-\u003eget('keyTwo.keyFive.0');              // output : true\n\n    // access non-existent value\n    echo $dotted-\u003eget('keyTwo.keySix');                 // output : null\n\n    // access value with default value\n    echo $dotted-\u003eget('keyTwo.keySix', 'defaultValue'); // output : defaultValue\n\n    // insert value\n    $dotted-\u003eset('keyTwo.keySix', 'valueSix');\n    echo $dotted-\u003eget('keyTwo.keySix');                 // output : valueSix\n\n    // insert value with override\n    $dotted-\u003eset('keyTwo.keySix', 6);                   // output : 6\n\n    // access values (array content)\n    $dotted-\u003egetValues();\n    /** output :\n      array:2 [▼\n        \"keyOne\" =\u003e \"valueOne\"\n        \"keyTwo\" =\u003e array:3 [▼\n          \"keyThree\" =\u003e 3\n          \"keyFour\" =\u003e false\n          \"keyFive\" =\u003e array:3 [▼\n            0 =\u003e true\n            1 =\u003e \"valueFive\"\n            2 =\u003e 5\n          ]\n        ]\n      ]\n    */\n\n    // access flatten values\n    $dotted-\u003eflatten();\n    /** output :\n      array:6 [▼\n        \"keyOne\" =\u003e \"valueOne\"\n        \"keyTwo.keyThree\" =\u003e 3\n        \"keyTwo.keyFour\" =\u003e false\n        \"keyTwo.keyFive.0\" =\u003e true\n        \"keyTwo.keyFive.1\" =\u003e \"valueFive\"\n        \"keyTwo.keyFive.2\" =\u003e 5\n      ]\n    */\n```\n\n## Credits\n\n[Aymen FNAYOU][link-author]\n\n## License\n\n![license](https://img.shields.io/badge/license-MIT-lightgrey.svg) Please see [License File](LICENSE.md) for more information.\n\n[link-author]: https://github.com/fnayou\n[link-composer]: https://getcomposer.org/\n[link-release]: https://github.com/fnayou/dotted/releases\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnayou%2Fdotted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnayou%2Fdotted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnayou%2Fdotted/lists"}