{"id":41710319,"url":"https://github.com/pdscopes/php-arrays","last_synced_at":"2026-01-24T21:42:35.266Z","repository":{"id":24487094,"uuid":"101732997","full_name":"pdscopes/php-arrays","owner":"pdscopes","description":"Helper functions for manipulating arrays","archived":false,"fork":false,"pushed_at":"2024-08-19T08:05:53.000Z","size":45,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T18:51:58.785Z","etag":null,"topics":["arrays","dot-notation","php"],"latest_commit_sha":null,"homepage":null,"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/pdscopes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-29T07:33:00.000Z","updated_at":"2024-08-19T08:01:07.000Z","dependencies_parsed_at":"2022-07-27T04:46:23.007Z","dependency_job_id":null,"html_url":"https://github.com/pdscopes/php-arrays","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/pdscopes/php-arrays","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdscopes%2Fphp-arrays","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdscopes%2Fphp-arrays/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdscopes%2Fphp-arrays/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdscopes%2Fphp-arrays/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdscopes","download_url":"https://codeload.github.com/pdscopes/php-arrays/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdscopes%2Fphp-arrays/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28737622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T21:19:41.845Z","status":"ssl_error","status_checked_at":"2026-01-24T21:13:38.675Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["arrays","dot-notation","php"],"created_at":"2026-01-24T21:42:34.666Z","updated_at":"2026-01-24T21:42:35.250Z","avatar_url":"https://github.com/pdscopes.png","language":"PHP","readme":"# madesimple/php-arrays\n[![PHPUnit](https://github.com/pdscopes/php-arrays/actions/workflows/phpunit.yml/badge.svg)](https://github.com/pdscopes/php-arrays/actions/workflows/phpunit.yml)\n\nHelper functions for manipulating arrays.\n\n## Arr \u0026amp; ArrDots\n`Arr` and `ArrDots` contains a set of static helper methods for arrays. These\nmethods can be used on both `array` and `\\ArrayAccess` objects. See the PHPDocs\ninside the classes for more information.\n\n## Dots\n`Dots` is an implementation of `\\ArrayAccess` that uses the functions\nfrom `\\MadeSimple\\ArrDots`. Instances of `Dots` can be passed into `ArrDots`\nas if it were an `array`.\n\nThere are three ways to create a `Dots`:\n```php\n// Create an empty dot array\n$dots = new \\MadeSimple\\Dots();\n\n// Create a dot array with a pre-existing array\n$dots = new \\MadeSimple\\Dots($array);\n\n// Create a dot array with \n$dots = new \\MadeSimple\\Dots([\n    'address' =\u003e [\n        'houseNo'  =\u003e '123',\n        'street'   =\u003e 'Fake St',\n        'postCode' =\u003e 'AB12 3CD',\n    ],\n    'comments' =\u003e [\n        'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',\n        'Donec nec pellentesque est.',\n        'Quisque volutpat quam et est laoreet, vitae consectetur erat molestie.',\n    ]\n]);\n```\n\nOnce a `Dots` is created you can replace the underlining array\nin the following ways:\n```php\n// Set an array after dot array\n// Changes will _not_ be reflected in the original array\n$dots-\u003esetArray($array);\n\n// Set an array as a reference\n// Changes will be reflected in the original array\n$dots-\u003esetReference($array);\n```\n\nBasic usage of `Dots`:\n```php\n// Get a value using dot notation:\necho \"Post Code: \", $dots['address.postCode'], PHP_EOL;\n\n// Set a value using dot notation:\n$dots['address.postCode'] = 'EF45 6GH';\necho \"Post Code: \", $dots['address.postCode'], PHP_EOL;\n\n// Remove a value using dot notation:\nunset($dots['address.postCode']);\necho \"Exists: \", (isset($dots['address.postCode']) ? 'yes' : 'no'), PHP_EOL;\n\n// Add a value using dot notation:\n$dots['address.postCode'] = 'IJ78 9KL';\necho \"Post Code: \", $dots['address.postCode'], PHP_EOL;\n\n// Access nth element in an sub array\necho \"Comment: \", $dots['comments.1'], PHP_EOL;\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdscopes%2Fphp-arrays","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdscopes%2Fphp-arrays","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdscopes%2Fphp-arrays/lists"}