It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data.
foreach
$values = get_val
Try this:
//Force array $dataArr = is_array($dataArr) ? $dataArr : array($dataArr); foreach ($dataArr as $val) { echo $val; }
;)