Q:

PHP Class example

Can anyone help me with php classes example.  I have to make class "information" that has information about users: id, email, password, first name, last name, phone. 
Also, class  must have a method to print all the user data on the output. 

A:

It's really simple skeleton, because you didn't try anything, so just for you to have idea how it works...
class User
{
   private $id;
   private $email;
   // ...

   public function __construct($id, $email...)
   {
      $this->id = $id;
      $this->email = $email;
      // ...
   }

   public function printAll()
   {
      return $this->id . ' ' .  $this->email;
   }
}

