You can add this row, before “foreach()”, if the variable $yourvariable is not always present
if (is_array($yourvariable) || is_object($yourvariable))
Further info here.
a thoughtful use of digital
You can add this row, before “foreach()”, if the variable $yourvariable is not always present
if (is_array($yourvariable) || is_object($yourvariable))
Further info here.