We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd7761b commit c2ce0a4Copy full SHA for c2ce0a4
README.md
@@ -89,3 +89,25 @@ Arr::has($data, 'xyz');
89
```
90
91
Note that `Arr::has()` can be replaced with `array_has()` if you prefer a functional approach.
92
+
93
+#### Array Set
94
95
+This helper sets a certain key in an array to a certain value.
96
+Dot notation can be used to create a deeply nested key.
97
98
+```
99
+$data = [];
100
+Arr::set($data, 'foo.bar', 'baz');
101
102
103
+`$data` now contains:
104
105
+[
106
+ 'foo' => [
107
+ 'bar' => 'baz',
108
+ ],
109
+];
110
111
112
+Note that `Arr::set()` can be replaced with `array_set()` if you prefer a functional approach.
113
0 commit comments