【发布时间】:2014-04-23 11:04:57
【问题描述】:
我在array.php 中创建了一个array,并想在另一个文件index.php 中使用它,我该怎么做?
这是我的数组:
$fruits[]=array(
"$int"=>array(
'a' => $apple,
'b' => $banana,
'c' => $citrus
)
);
【问题讨论】:
-
“传入 index.php”是什么意思?你是
requireing index.php 在那个文件的末尾吗? -1,因为不清楚。 -
什么是“走到尽头”
-
你试过了吗?将其添加到会话并在 index.php 中访问它?
-
我猜这只是知识上的一大差距。你想做什么——你的最终目标是什么?也许我们知道比
passing this array from one php document to another更好的方法。 -
要打印整个数组 .. 使用
print_r($fruits);,正如我在回答中向您展示的那样。
标签: php arrays function multidimensional-array output