我需要从数组获取此输出
$properties = array(
1 => array('one', 'two'),
2 => array('red', 'blue'),
3 => array('active', 'not-active'),
);
谢谢!
答案 0 :(得分:0)
我希望这是您要寻找的。很简单,但是根据您的问题:就足够了。
<?php
$properties = array(
1 => array('one', 'two'),
2 => array('red', 'blue'),
3 => array('active', 'not-active'),
);
/*echo "<pre>";
print_R($properties);
echo "</pre>";*/
//Not needed but stil useful for troubleshooting.
foreach ($properties[1] as $value_array_one) {
foreach ($properties[2] as $value_array_two) {
foreach ($properties[3] as $value_array_three) {
echo $value_array_one . "_" . $value_array_two . "_" . $value_array_three . "<br/>";
}
}
}
?>