大家好,我想只输出每个产品的名称和产品的价格。 我不想输出ID或其他东西。
<?php
$a = array(
array('id' => '1', 'name' => 'Milch','price' => '12'),
array('id' => '2', 'name' => 'Reis','price' => '13'),
array('id' => '3', 'name' => 'Öl','price' => '14'),
array('id' => '4', 'name' => 'Salz','price' => '15'),
array('id' => '5', 'name' => 'Zucker','price' => '16'),
);
foreach ($a as $key => $value){
print_r($a[$key]);
}
?>
答案 0 :(得分:0)
foreach ($a as $product) {
echo $product['name'] . ': $' . $product['price'] . '<br />';
}
答案 1 :(得分:0)
UIWebView *myWebView;
....
[myWebView setFrame:CGRectMake(newX, newY, floor(newWidth), floor(newHeight)];