我需要从数组中得到这个输出
$properties = array(
1 => array('one', 'two'),
2 => array('red', 'blue'),
3 => array('active', 'not-active'),
);谢谢!
发布于 2018-10-13 20:17:02
我希望这就是你要找的。很简单,但基于你的问题:应该足够了。
<?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/>";
}
}
}
?>https://stackoverflow.com/questions/52796620
复制相似问题