You might want to see if the $data
variable is available. If that is null, then you can't access an element inside a non-existent variable.
if (isset($data)) {
if(isset($data['variable'])) { $variable = $data['variable']; }
else {
//THIS MAKES NO SENSE. $data['variable'] does not exist.
//$variable = numberFormat($data['variable']);
//You can put something else in here, however
$variable = "";
}
}
Secondly, accessing $data['variable']
when it does not exist is non-sensical because... well I doesn't exist!