I have an array that contains string that have underscores or _ in them, I need to replace the underscores with spaces using str_replace and I want to do it using array_map()
array_map can take function that only have one parameter in them but str_replace takes three parameters:
- What to replace
- Replace it with what
- String
I can perfectly use a foreach loop to do the following but I was wondering how would I be able to do it with array_map. I did some looking on google and in stackoverflow but I couldn't find a solution.
Here's an example of the array that I have
$array = array("12_3","a_bc");