<? $i = 1; foreach($_POST as $day => $task){ foreach($task as $task){ print $i . ") " . $day . ": " . $task . "\n"; $i++; } } ?>