php 从另一个页面包含的数组中获取值
php fetching value from array which is included from another page
<?php
return array(
'master' => array(
'details' => array(
'location' => 'chennai'
),
),
);
如何从上面的数组中获取值
我需要分配$Location = 'chennai'
但是我怎样才能从上面的数组中获取位置的值呢?
注意:部分代码是从另一个位置获取的,即包含
$array = include('/path/to/that/file.php');
$location = $array['master']['details']['location'];
<?php
return array(
'master' => array(
'details' => array(
'location' => 'chennai'
),
),
);
如何从上面的数组中获取值
我需要分配$Location = 'chennai'
但是我怎样才能从上面的数组中获取位置的值呢?
注意:部分代码是从另一个位置获取的,即包含
$array = include('/path/to/that/file.php');
$location = $array['master']['details']['location'];