我已经看过很多关于如何从二维数组中获取数据的教程,但我需要构建一个与此类似的教程,但我没有找到任何可以遵循的逻辑:
$array = array("socks" => array("blue", "red", "green"),
"shirts" => array("small", "medium", "large"));
我似乎无法弄清楚甚至启动代码的逻辑....
for each clothingType // I did this
get options // I did this
for each option //I did this
add to the clothingOption Array //... help!
我只停留在clothingOption 2D Array的构建上
会不会有点像
foreach clothingType as $kClothes =>VClothes
get Options
for each Options as $kOptions =>$VOption
$array[$VClothes][]= $VOption
谢谢,我希望这不是太模糊......