title: Creating display date function in php, OOP way
body: <p>I am beginning to learn PHP OOP and I have this exercise to create a a function displaying a date.
  I would like to come up with this result:
      $date = new ("14-01-2014"); // for example, this date from user</p>
  
  <pre><code>echo $date -&gt; displaDate ('YYYY-MM-JJ'); // Would result to 2014-01-14
  echo $date -&gt; day; //Would result to 14
  echo $date -&gt; dayOfWeek; //Would result to Thursday
  </code></pre>
  
  <p>Can someone please explain to me how to start making a function for this?  I understand that functions has variables and methods.  </p>