Skip to content

Commit df5da1d

Browse files
committed
Document array_short method.
1 parent ecaee85 commit df5da1d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

helpers.md

+14
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@ The `array_set` method will set a value within a deeply nested array using "dot"
126126

127127
array_set($array, 'names.editor', 'Taylor');
128128

129+
### array_sort
130+
131+
The `array_sort` method sorts the array by the results of the given Closure.
132+
133+
$array = array(
134+
array('name' => 'Jill'),
135+
array('name' => 'Barry'),
136+
);
137+
138+
$array = array_values(array_sort($array, function($value)
139+
{
140+
return $value['name'];
141+
}));
142+
129143
### head
130144

131145
Return the first element in the array. Useful for method chaining in PHP 5.3.x.

0 commit comments

Comments
 (0)