The following code takes answers from subject input, and creates the input as item for a slider question.
$dataMon = dbGet('mon-'.caseSerial());
$dataTue= dbGet('tue-'.caseSerial());
$dataWed = dbGet('wed-'.caseSerial());
$data = array_merge($dataMon, $dataTue, $dataWed);
foreach ($data as $key => $text) {
if (trim($text) != '') {
$itemID = $key + 1;
replace('%item'.$itemID.'%', $text);
}
}
However, empty text inputs are still counted as items even though:
if (trim($text) != '') {...}
Is supposed to prevent that right? Here are the error codes I get:
And here is what the entries in the database look like:
To be clear: If mon-2, mon-[3], mon-[4] are empty, they shouldn't become an item in the slider.
Any ideas what is going wrong here? I appreciate the time and help!