PHP array_map for multidimensional arrays

Array map is one of the interesting PHP’s array function. But it will not work with multidimensional arrays as expected.So in this post, I would like to share a simple alternative technique for array_map(). Our function will work like array_map but it will support multidimensional arrays.

Here we used recursive function methodology and the Ternary Operator syntax.

How to use

you can use my_array_map just like as array_map().

That’s it.

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.