Utilizes preg_filter to add the specified prefix to each item in the array. There are other methods, but this is fast and a single-liner.
Source code viewer
// Original array // Use preg_filter to add the prefix $prefixed_array = preg_filter('/^/', 'prefix_', $array); // Display the modified arrayProgramming Language: PHP