Ways to load an array from file into a variable:
1-
$var = require 'myarray.php'; // or include
// myarray.php contents
return array("test","test2");
2 –
require 'myarray.php'; // or include
// myarray.php contents
$var = array("test","test2");
Use $var as you would normally.
3-
$var = file_get_contents('myarray.php');
// myarray.php contents
array("test","test2");