問題:
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?任何想法如何做到這一點?