1

I have a large "config" array that I want to store in a different file (taking this practice from Laravel's config files).

After storing it in app/config/myconfig.php

<?php
return array(
  'foo' => 'bar',
);

How would I call this in my code if I wanted to assign it? E.g. $myarray = app/config/myconfig.php

Helen Che
  • 1,951
  • 5
  • 29
  • 41

1 Answers1

5

Include the file:

    $myarray = include 'app/config/myconfig.php';
Bart Haalstra
  • 1,062
  • 6
  • 11