Here's the code
$fieldname[0] = "FirstName";
$fieldname[1] = "LastName";
$fieldname[2] = "Title";
$fieldname[3] = "Organization";
$fieldname[4] = "Address1";
$fieldname[5] = "Address2";
$fieldname[6] = "City";
$fieldname[7] = "State";
$fieldname[8] = "Zip";
$fieldname[9] = "Country";
$fieldname[10] = "Phone";
$fieldname[11] = "Fax";
$fieldname[12] = "username";
$fieldname[13] = "URL";
$fieldname[14] = "GroupSize";
$fieldname[15] = "WhenDoingFundraiser";
$fieldname[16] = "SalesPriceRange";
$fieldname[17] = "FundraisingDollarGoal";
$fieldname[18] = "FundraiserType";
$fieldname[19] = "OrganizationDescription";
$fieldname[20] = "Comments";
$ct = 0; //the starting fieldname array number
$tot = 20; //the ending fieldname array number
$body = "";
while ($ct <= $tot){
$body = $body.$fieldname[$ct].": ".$_POST[$fieldname[$ct]]."/n";
}
Is there a way that PHP will automatically count the number of items in an array so that $tot can automatically be totalled?