Repository navigation
Home
github-actions[bot] edited this page Oct 5, 2026
·
2 revisions
Dalue maps nested arrays, objects and JSON documents into a new structure described by a plain PHP array (the schema). It is built on uuur86/strobj, which reads the source data with slash-separated paths.
use Dalue\Mapper;
use StrObj\StringObjects;
$data = StringObjects::instance('{"user":{"id":7,"name":"Jane"}}');
$result = Mapper::map($data, [
'id' => '@data/user/id',
'name' => '@data/user/name',
'source' => 'api',
]);
// ['id' => 7, 'name' => 'Jane', 'source' => 'api']Dalue is licensed under GPL-3.0-or-later. Source: uuur86/dalue · Edit these pages in docs/wiki.