fork download
  1. <?php
  2.  
  3. $d = array(5, 6.5, 10, 3.355, 400, 9.43);
  4. $c = 2;
  5.  
  6. print_r(array_map(function ($e) use ($c) { return $e + $e * $c / 100; }, $d));
  7.  
  8.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 5.1
    [1] => 6.63
    [2] => 10.2
    [3] => 3.4221
    [4] => 408
    [5] => 9.6186
)