我有这个来打印数组中的值。
<?php foreach ($product->data['attributes'] as $attribute => $option) {
echo '<li>'. t('@attribute: @options', array('@attribute' => $attribute, '@options' => implode(', ', (array)$option))) .'</li>';
} ?>
上面的代码打印了属性数组中的所有内容:
[products] => Array
(
[0] => stdClass Object
(
[data] => Array
(
[attributes] => Array
(
[Duration] => Array
(
[4] => 2 Years
)
[Anchor Text] => Array
(
[0] => asdf
)
[URL] => Array
(
[0] => asdddddd
)
[Feed ID] => Array
(
[0] => 32845898
)
)
)
)
)
我只想打印 [URL] 和 [Feed ID]...