File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,15 @@ $dot = dot();
67
67
$dot = dot($array);
68
68
```
69
69
70
+ It is possible use an alternative delimiter from the default dot (` . ` ) with the second constructor parameter. Using an underscore instead:
71
+
72
+ ``` php
73
+ $dot = new \Adbar\Dot($array, '_');
74
+
75
+ // With the helper
76
+ $dot = dot($array, '_');
77
+ ```
78
+
70
79
## Methods
71
80
72
81
Dot has the following methods:
Original file line number Diff line number Diff line change 11
11
12
12
if (! function_exists ('dot ' )) {
13
13
/**
14
- * Create a new Dot object with the given items
14
+ * Create a new Dot object with the given items and optional delimiter
15
15
*
16
- * @param mixed $items
16
+ * @param mixed $items
17
+ * @param string $delimiter
17
18
* @return \Adbar\Dot
18
19
*/
19
- function dot ($ items )
20
+ function dot ($ items, $ delimiter = ' . ' )
20
21
{
21
- return new Dot ($ items );
22
+ return new Dot ($ items, $ delimiter );
22
23
}
23
24
}
You can’t perform that action at this time.
0 commit comments