As was mentioned before, simply use one loop to check everything, then another to process everything if the checks were all successful.
$failure = false;
for($x=0;$x<$i;$x++){
if (
empty($_POST["datum".$x]) ||
empty($_POST["campus_id".$x]) ||
empty($_POST["lesuur".$x]) ||
empty($_POST["klasgroep".$x]) ||
empty($_POST["leerkracht".$x]) ||
empty($_POST["lokaal".$x]) ||
empty($_POST["vervanger".$x]) ||
empty($_POST["vervanglokaal".$x])||
empty($_POST["opmerking".$x])
)
{
$failure = true;
}
}
if(!$failure) {
for($x=0;$x<$i;$x++){
processForm($x);
}
$_SESSION['opgeslagen']=1;
header('Refresh: 0;url=invoer.php');
}