Skip to content
Advertisement

Add new dimension to array in php [closed]

I don’t know how to ask the question.My goal is :

convert :

JavaScript

into :

JavaScript

Advertisement

Answer

Start with the value to be assigned, then for-loop backwards over the array:

JavaScript

Output:

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