function _set_number($num, $type) { $found = false; for ($i = 0; $i < count($this->phone_numbers); $i++) { if ($this->phone_numbers[$i]->type == $type) { $found = true; $this->phone_numbers[$i]->set_phone($num); } } if ($found == false) { $p = new PhoneNumber("", $this->id); $p->set_type($type); $p->set_phone($num); $this->phone_numbers[] = $p; //print_r($this->phone_numbers); //echo "num is now:" . $p->get_phone_display() . "<br />"; } }