title: How to find the date of a day of the week from a date using PHP?
body: <p>If I've got a <code>$date</code> <code>YYYY-mm-dd</code> and want to get a specific <code>$day</code> (specified by 0 (sunday) to 6 (saturday)) of the week that <code>YYYY-mm-dd</code> is in.</p>
  
  <p>For example, if I got <code>2012-10-11</code> as <code>$date</code> and <code>5</code> as <code>$day</code>, I want to get <code>2012-10-12</code>, if I've got <code>0</code> as <code>$day</code>, <code>2012-10-14</code></p>
  
  <p><strong>EDIT:</strong><br>
  Most of you misunderstood it. I got some date, <code>$date</code> and want to get a day specified by 0-6 of the same week <code>$date</code> is in.</p>
  
  <p>So no, I don't want the day of <code>$date</code>...</p>