0
我再次, 我不明白我怎么能实现一个外部文件(a.php)multidimensionak数组在其他文件(b.php)来使用它!php如何包括一个文件多个数组
a.php只会仅仅实现了代码:
<?php
$array[1][0] = array("gutes"=>"something_1");
$array[2][0] = array("gutes"=>"something_2");
$array[3][0] = array("gutes"=>"etc.");
$array[4][0] = array("gutes"=>"etc.2");
//..
//many many more.
?>
b.php包括:
<?php
//tried calls
//include("../path/a.php"); -> err 500
//@require_once("a.php"); -> err 500
//require("fehleranalyse_array_lebenslauf2.php"); ->err 500
//require_once("fehleranalyse_array_lebenslauf2.php");
//strange, i did not get an err 500, but also not the right output
//i see Test: but not Test: something_1
//include a.php;
//just for own tests: without including paths and only with that it works well
//$array[1][0] = array("gutes"=>"something_1");
$testname_array = "gutes";
echo "Test: " . $array[1][0][$testname_array] . "<br>";
?>
SRY基因,但我看不到我的失败! TY
一个问题,是文件a.php和b.php在同一个文件夹或不同的文件夹? – Synkronice
@Synkronice在同一个文件夹.. ../路径我试图说,路径是独立的... –