ronappleton / php-dot
Set and get array values via dot notation.
Installs: 39
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/ronappleton/php-dot
Requires
- php: >=4
This package is auto-updated.
Last update: 2025-09-25 10:32:30 UTC
README
Php Dot allows you to add and retreive values from a php array via dot notation.
Installation
composer require ronappleton/php-dot "v1.0"
Usage
Declare use RonAppleton\Dot\Dot;
at the top of your file.
Then:
$dot = new Dot;
$value = $dot->get($array, 'key.to.your.value', $defaultValue);
$success = $dot->set($array, 'key.to.append.value', $value);
Note: set accesses the array via reference and returns true on success.