if(!is_null($value)) { $json = json_decode($value, true); $value = json_last_error() === JSON_ERROR_NONE ? $json : $value; }