[ create a new paste ] login | about

Link: http://codepad.org/h88Is8ug    [ raw code | output | fork ]

PHP, pasted on Jan 4:
1
2
3
4
<?php
$array = array('one' => 'val1', 'two' => 'val2');
array_walk($array, create_function('$value, &$key', '$key = "prefix" . $key;'));
var_dump($array);


Output:
1
2
3
4
5
6
array(2) {
  ["one"]=>
  string(4) "val1"
  ["two"]=>
  string(4) "val2"
}


Create a new paste based on this one


Comments: