Created
December 12, 2017 00:08
-
-
Save Jul10l1r4/e068cc26ef619bfdcb984c696b4eb5c3 to your computer and use it in GitHub Desktop.
Array_map created by Jul10l1r4 - https://repl.it/@Jul10l1r4/Arraymap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$users = [ | |
[ 'idade' => 29, 'nome' => 'Marcos lucim' ], | |
[ 'idade' => 20, 'nome' => 'Marcos ' ], | |
[ 'idade' => 50, 'nome' => 'Marcelo dougras' ], | |
]; | |
function passa ( $val ){ | |
return $val; | |
}// Isso é uma função pura :) | |
$val_saida = array_map( "passa", $users ); | |
// Aqui meu array map vai usar a função no array, ele poderia fazer outras coisas | |
print_r($val_saida); | |
//print_r no caso é para que possa ter uma saída | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment