How can I get parent list of doc
and then list it out in an array
so I can loop the list out in colunms of choices
How to make an array for print out ’menutitle’
????????
$states= array(
???);
this is the code for list out in columns, $states change with ’ menutitle of parent ’
//***********************************************************************
// $states= array("Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado",
// "Connecticut", "Delaware", "Dist of Columbia", "Florida", "Georgia", "Hawaii", "Idaho", "Illinois",
//"Indiana", "Iowa", "Kansas", "Kentucky", "Louisiana", "Maine", "Maryland", "Massachusetts",
//"Michigan", "Minnesota", "Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire",
//"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota", "Ohio", "Oklahoma",
//"Oregon", "Pennsylvania", "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
//"Texas", "Utah", "Vermont", "Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming");
//number of records
$num_records = sizeof($states);
//max number of columns
$max_cols = 3;
//find the number of records that should be in each column
$records_per_col = ceil($num_records / $max_cols);
print ’<strong>Displaying State Data in Columns</strong>
’;
print ’<table border = "1" width = "100%">
<tr>
<td valign = "top">
<table border = "0">
<tr>’;
//start a $count variable
//its here to match up with the $records_per_col for comparison as seen below
//in the loop
$count = 0;
foreach ($states as $state) {
//check if the current count is greater than the $records_per_col
if ($count >= $records_per_col) {
print ’</tr></table></td><td valign = "top"><table border = "0"><tr>’;
//set the count variable back to 0 or else there will be a ton of columns
$count = 0;
} else {
//if not start a new row for the next piece of data
print ’</tr><tr>’;
}
//print the data
print ’<td>’.$state.’<td>’;
//increment the $count variable
$count++;
}
print ’</table>
</td>
</tr>
</table>’;
//***********************************************************************
Many thanks