UTILITY

set_path()

Set a nested array value using dot notation.

Signature

void set_path(array &$array, string $path, mixed $value)

Example

set_path($data, 'user.name', 'Ada');

Available from: 1.5.0

Reference navigation

Previous: replace_last()

Next: slugify()

Back to utilities