fork(2) download
  1. <?php
  2.  
  3. $corretor = array(
  4. 'Carlos',
  5. 'Andre',
  6. 'Rosinei',
  7. 'Vinicius',
  8. 'Thales'
  9. );
  10. $comissao = array(
  11. 5,
  12. 3,
  13. 3,
  14. 3,
  15. 2
  16. );
  17.  
  18. function misturar($nome, $perc){
  19. return $nome.' - '.$perc.'%';
  20. }
  21.  
  22. $c = array_map("misturar", $corretor, $comissao);
  23. echo implode($c, ' | ');
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Carlos - 5% | Andre - 3% | Rosinei - 3% | Vinicius - 3% | Thales - 2%