title: PHP if condition based on date not working
body: <p>I want to execute a <code>if</code> statement where I want if given <code>{date}</code> is less or equal than <code>today</code> then <code>{due_amount}= {paidbystudent}</code> else <code>{due_amount}= '0'</code></p>
  
  <p>Here is my code:</p>
  
  <pre><code>if ({date} &lt;= Today()) {
      {due_amount}={paidbystudent};
  }  else {
      {due_amount}='0';
  }
  </code></pre>
  
  <p>But its not working. Please help me how to do this.</p>
  
  <p>I have also tried this code but its not working properly this is checking only date and ignoring month and year </p>
  
  <pre><code>$todays_date=date("d/m/Y", strtotime("today"));
  $date=date("d/m/Y", strtotime({date}));
  
  if ($date &lt;= $todays_date) {
      {due_amount}={paidbystudent};
  }  else {
      {due_amount}='0';
  }
  </code></pre>