问题:
I have a PHP file a configuration file coming from a Yii message translation file which contains this:我有一个 PHP 文件,一个来自Yii消息翻译文件的配置文件,其中包含以下内容:
<?php
return array(
'key' => 'value'
'key2' => 'value'
);
?>
I want to load this array from another file and store it in a variable我想从另一个文件加载这个数组并将其存储在一个变量中
I tried to do this but it doesn't work我试图这样做,但它不起作用
function fetchArray($in)
{
include("$in");
}
$in
is the filename of the PHP file $in
是 PHP 文件的文件名
Any thoughts how to do this?任何想法如何做到这一点?