I have this PHP script:
for ($desc=1; $_POST['ddata'.$desc]; $desc++) {
if($_POST['ddata'.$desc]){
if ($desc == 1){
$ddata = $_POST['ddata'.$desc];
$dlocatie = $_POST['dlocatie'.$desc];
} else {
$ddata = $ddata.' / '.$_POST['ddata'.$desc];
$dlocatie = $dlocatie.' / '.$_POST['dlocatie'.$desc];
}
}
}
If I have 5 ddata
fields, it gives this error: Undefined index: ddata6
How can I check if that fields exists so I can prevent this error?