从关联数组中获取值
我有以下主数组,称为$m
Array
(
[0] => Array
(
[home] => Home
)
[1] => Array
(
[contact_us] => Contact Us
)
[2] => Array
(
[about_us] => About Us
)
[3] => Array
(
[feedback_form] => Feedback Form
)
[4] => Array
(
[enquiry_form] => Products
)
[5] => Array
(
[gallery] => Gallery
)
)
我有值,例如home,contact_us存储在$options数组中,我需要使用$options数组从名为$m的主数组中获取值
例如。如果$options数组具有值 home,我需要从主数组中获取值 Home($m)
我的代码如下所示
$c = 0;
foreach($options as $o){
echo $m[$c][$o];
++$c;
}
我不知何故无法从主数组接收值?