function addField($attributes) { if (isset($attributes['NAME'])) { $name = $attributes['NAME']; } else { $name = count($this->data[$this->row]); } // Set the field index so we know where we are $this->current_field = $this->FieldID($name); }