I don't know if this is even called "hardcoding", but I would like to build an array (for example from a mysqli_fetch_assoc query) and output it for reuse in a config.php file.
So this output from mysql would be:
[structure] => Array
(
[0] => Array
(
[structureid] => 23
[active] => 1
)
[1] => Array
(
[structureid] => 25
[active] => 1
)
And it would be stored like this in a config.php file:
$structure[0]['structureid'] = 23;
$structure[0]['active'] = 1;
$structure[1]['structureid'] = 25;
$structure[1]['active'] = 1;
Is there an easy and quick way to accomplish this?
As someone has pointed out, I could resolve this with using a json file - which I'm already doing - but I wanted to check if there would be another (quick) way of doing it as described above.