Simplify the generation of the local configuration file
by replacing various loops with shorter PHP standard methods.
This will cause the local configuration to have a slightly
different style, but it is still an array therefore is
readable and changeable by PHP developers.