[eluser]Xeoncross[/eluser]
[quote author="xwero" date="1229438060"]I don't think you can create the array you desire without adding some assumptions into your code... which of the type items needs to be repeated, the first or the the second?[/quote]
That is the fun of this challenge - I need all variations of the array created. The array may have 2+ children arrays of 1+ elements (max depth of all this is 2). So I want all of the type arrays created and all of the wade arrays created, and so forth.
Here is another example:
Code:
<?php
array(3) {
["type"]=>
array(1) {
[0]=> string(10) "ROOFDRAINS"
[0]=> string(11) "FLOORDRAINS"
}
["wade"]=>
array(2) {
[0]=> string(4) "3000"
}
["zurn"]=>
array(1) {
[0]=> string(7) "ZRB104"
[0]=> string(7) "ZRB105"
[0]=> string(7) "ZRB106"
}
}
//INTO:
array(2) {
[0]=>
array(3) {
["type"]=> string(10) "ROOFDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB104"
}
[1]=>
array(3) {
["type"]=> string(10) "ROOFDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB105"
}
[2]=>
array(3) {
["type"]=> string(10) "ROOFDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB106"
}
[3]=>
array(3) {
["type"]=> string(11) "FLOORDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB104"
}
[4]=>
array(3) {
["type"]=> string(11) "FLOORDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB105"
}
[5]=>
array(3) {
["type"]=> string(11) "FLOORDRAINS"
["wade"]=> string(4) "3000"
["zurn"]=> string(7) "ZRB106"
}
}
?>
Hey, thanks for your code. I can't try it now but I appreciate it.