我有下一个数组:
$array = array
(
'body' => 'array ("color" => "blue", "font-weight" => "bold")',
'div' => 'array ("color" => "red", "background" => "blue")'
);
我希望,例如,将body
' "color" => "blue"
编辑为"color" => "black"
。
从这些数组中提取数据并将其打印出来很简单:
foreach ($array as $element_name => $element_style){
echo $array_part_name . '{';
foreach ($array_part_style as $property_name => $property){
echo $property_name . ': ' . $property . '; '
}
echo '}'
}
我想它应该像css一样产生,但我如何编辑那个特定的部分呢? (如上所述)
答案 0 :(得分:0)
configurations{
all*.exclude module: 'okhttp'
all*.exclude module: 'okio'
}
然后你可以像这样改变身体颜色:
$array = array
(
'body' => array("color" => "blue", "font-weight" => "bold"),
'div' => array ("color" => "red", "background" => "blue")
);
如果你想遍历所有的项目和子项目,你会这样做:
$array['body']['color'] = 'black';