Refactoring PHP for loops with array_map()

Consider the following block of code: You have an array that you need to change in some way so you loop through the array, using a for-loop, alter each item, and push it in to a new array, using array_push() or my_array[] = $value, which you then return or assign to a variable. This is not uncommon; I […]