Skip to content

Commit 2ca2c29

Browse files
committed
Merge pull request laravel#434 from neoascetic/patch-1
Improve array_fetch example to show the difference with array_pluck
2 parents 1c23a48 + 19692e9 commit 2ca2c29

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

helpers.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,12 @@ The `array_except` method removes the given key / value pairs from the array.
4545

4646
The `array_fetch` method returns a flattened array containing the selected nested element.
4747

48-
$array = array(array('name' => 'Taylor'), array('name' => 'Dayle'));
48+
$array = array(
49+
array('developer' => array('name' => 'Taylor')),
50+
array('developer' => array('name' => 'Dayle')),
51+
);
4952

50-
var_dump(array_fetch($array, 'name'));
53+
$array = array_fetch($array, 'developer.name');
5154

5255
// array('Taylor', 'Dayle');
5356

0 commit comments

Comments
 (0)