Я использую следующий массив
Array
(
[0] => Array
(
[id] => 6
[key] => SITE_NAME
[value] => Webg Smarty CMS Small
[name] => general
[title] => website name
[type] => text
)
[1] => Array
(
[id] => 32
[key] => PHONE_NUMBER
[value] => 713-332-4675
[name] => general
[title] => Phone Number
[type] => text
)
)
Я хочу показать [0] [значение], [1] [значение]
Я использую foreach, но я не могу напечатать значения
как это показать?
<?php
//$arr = your nested array aboe
foreach($arr as $v){
echo $v['value']; //this will print 'Webg Smarty CMS Small' first in your example followed by '713-332-4675'
}
$arr[0]['value'] will give you 'Webg Smarty CMS Small'
$arr[1]['value'] will give you '713-332-4675'
Попробуй это
foreach($yourArr as $key => $value)
{
echo $value['value'];
}
ИЛИ ЖЕ
echo $yourArr[0]['value']; //print value of first element
echo $yourArr[0]['key']; //print key of first element