I need to get this output from array
$properties = array(
1 => array('one', 'two'),
2 => array('red', 'blue'),
3 => array('active', 'not-active'),
);
Thx!
I hope this is what you are looking for. Simple, but based on your question: it should suffice.
<?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/>";
}
}
}
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.