Revert "Revert "Refactored php array""

This reverts commit cdf73c98a705c2398730b0a368bb7bdc43765c56.
Reverted