Hello I need some advice (I'm not expecting code - Just want to know if it's possible / references)

Basically, I want to create a class that I can check if the email has been submitted AND also, if it's formatted right (e.g. does it contain a @ but also go into a lot more depth) so it'd look a bit like:


   include ('validationClass.php');

   $validation = new Validation();

      echo 'Yes';

So like:


Any suggestions? =)

Is there a particular reason you want to call two functions like that ? IMO readability will suffer greatly. Let alone designing how validate and formatted should interact with each other (like handling validation errors).

Technically, it should be possible, if the validate function returns an object with a formatted method.