I have some really ugly code and I need help to clean it up. I'm sure there must be a better way. I have a $_POST variable with entries start_doy0, start_doy1, start_doy2 etc.
The later entries my not be filled and I need to find up to what doy they are filled. I cant start with $completed_index = -1 because there is no start_doy-1.
#Assume at least one line full, index 0.
$completed_index = 0;
while (!empty($_POST['start_doy'.$completed_index]))
{
$completed_index++;
}
# $_POST['start_doy'.$completed_index] was empty, decrement $completed_index.
$completed_index--;
Thnks, Matt