tjmcd
11-25-2007, 06:38 PM
Hey all,
You know I have RT'd the FM until I am blue in the face (maybe I need a new FM?) and poured over every tutorial I can find, but as is ALL-TOO-OFTEN the case neither the examples in the FM nor those in the tutorials are EVER a good analogy for the real world problem I am trying to solve.
Given the multidimensional array below, I can manage a count of the first level arrays as:
$section_count = count($colorOpts);
//then ...
for ( $section = 0; $section < $section_count; $section++)
{ bla bla bla } but please, how would I get a ROW count FOREACH of the third level arrays contained therein? <?php //colorOpts.php
$colorOpts=array(
//colOpts1
array( array( Title => "RGB"),
array( "Red",
"Green",
"Blue"
)
),
//colOpts2
array( array( Title => "CMYK"),
array( "Cyan",
"Magenta",
"Yellow",
"Black"
)
),
//colOpts3
array( array( Title => "Pastels"),
array( "Pink",
"Mauve",
"Lavender",
"Teal"
)
),
);
?>RGB_options_count would =3 , CMYK_options_count_ would =4 etc.
Of course, it is entirely possible that I have the syntax of the array all wrong to begin with so... ???:eek:
You know I have RT'd the FM until I am blue in the face (maybe I need a new FM?) and poured over every tutorial I can find, but as is ALL-TOO-OFTEN the case neither the examples in the FM nor those in the tutorials are EVER a good analogy for the real world problem I am trying to solve.
Given the multidimensional array below, I can manage a count of the first level arrays as:
$section_count = count($colorOpts);
//then ...
for ( $section = 0; $section < $section_count; $section++)
{ bla bla bla } but please, how would I get a ROW count FOREACH of the third level arrays contained therein? <?php //colorOpts.php
$colorOpts=array(
//colOpts1
array( array( Title => "RGB"),
array( "Red",
"Green",
"Blue"
)
),
//colOpts2
array( array( Title => "CMYK"),
array( "Cyan",
"Magenta",
"Yellow",
"Black"
)
),
//colOpts3
array( array( Title => "Pastels"),
array( "Pink",
"Mauve",
"Lavender",
"Teal"
)
),
);
?>RGB_options_count would =3 , CMYK_options_count_ would =4 etc.
Of course, it is entirely possible that I have the syntax of the array all wrong to begin with so... ???:eek: