fork(1) download
  1. <?php
  2.  
  3. $input = array('fruit' => 'apple', 'car' => 'volvo');
  4.  
  5. $array = array_combine(
  6. array_map(function($k){ return '$'.$k; }, array_keys($input))
  7. , $input
  8. );
  9.  
  10. print_r($array);
  11.  
  12. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [$fruit] => apple
    [$car] => volvo
)