title: How to schedule events in PHP
body: <p>I am creating a processing system in PHP, I read tons of tutorials over the internet but nothing
  seems to satisfy what I need for my system.</p>
  
  <p>I have table SCHEDULE in SQL..</p>
  
  <pre><code>+----+------+---------------------+
  | ID | Name |     Description     |
  +----+------+---------------------+
  |    |      |                     |
  |  1 | D    | Daily               |
  |  2 | W    | Weekends            |
  |  3 | EOM  | End Of the month    |
  |  4 | 11d  | 11 day of the month |
  |  5 | M    | Monday              |
  +----+------+---------------------+
  </code></pre>
  
  <p>And Table PROCESS..</p>
  
  <pre><code>+----+---------------+-----------+
  | ID | Schedule_id   |   Name    | 
  +----+---------------+-----------+
  |  1 |             1 | Process 1 | 
  |  2 |             2 | Process 2 | 
  |  3 |             3 | Process 3 |  
  +----+---------------+-----------+
  </code></pre>
  
  <p>What I want is to automatically show the process on each days base on their schedule.</p>
  
  <p>Meaning:</p>
  
  <p><strong>if  Process1 = D RUN Process1 everyday</strong></p>
  
  <p><strong>if Process2 = W   RUN ONLY Process2 on weekends</strong></p>
  
  <p><strong>if Process3 = 11d RUN ONLY Process3 on the 11th day of the month</strong></p>
  
  <p>I also want them to store on my calendar and also how about holidays? 
  All answers will be appreciated thanks. </p>