fork(1) download
  1. <?php
  2.  
  3. $example = array ('10'=> 25, "15"=> 30, '20'=>22);
  4.  
  5. $result = array();
  6.  
  7. foreach ($example as $key => $value){
  8. $result[$key] = $key*$value;
  9.  
  10.  
  11. }
  12.  
  13. var_dump($result);
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
array(3) {
  [10]=>
  int(250)
  [15]=>
  int(450)
  [20]=>
  int(440)
}