Skip to content
Advertisement

Change Array Key Names with PHP

I have an array that has 4 elements with the same key names, for example:

JavaScript

Is there any easy way that I can loop through this with PHP and change the key names to be:

JavaScript

Advertisement

Answer

JavaScript

if you want json then

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement