What is the fastest way to add string prefixes to array keys?
Input
$array = array( \'1\' => \'val1\', \'2\' => \'val2\', );
Another way to do achieve is with array_flip()
&$val) { $val = "prefix" . $val; } $data = array_flip($data);