<?php Class User{ private string $email; private string $password; public $errors = []; public function __construct(string $email, string $password){ $this->email = $email; $this->password = $password; } public function validateEmail($email){ if(!filter_var($this->email, FILTER_VALIDATE_EMAIL)){ $this->errors[] = "falsche email"; return false; } else { return true; } } public function validatePassword($password){ If((strlen($password)<4) | (strlen($password)>6)){ $this->errors[] = "passwort zu kurz oder zu lang"; return false; } else { return true; } } public function getEmail(){ return $this->email = $email; } public function setEmail(){ $this->email = email; } } ?>
You have javascript disabled. You will not be able to edit any code.