我是 PHP 新手并且正在使用 php5.2,我需要将文件内容转换为二维数组,即我的文件内容将是
"Higher Studies" => "#",
"Symposiums" => "#",
"Conferences" => "#"
我的预期输出是,
Array ( [Higher Studies] => # [Symposiums] => # [Conferences] => # )
PHP函数我试图实现这一点,
$values = file_get_contents($url);
echo $values;
$array = explode(",", $values);
$array = array(file_get_contents($url));
$array = file('http://localhost/test1.php');
最后我得到这样的答案,
Array ( [0] => "Higher Studies" => "#", [1] => "Symposiums" => "#", [2] => "Conferences" => "#" )
这是我们可以从文件中读取的可能方式,还是可以获得像我预期的那样的解决方案?