title: difference between two dates in days in php using codeigniter
body: <p>I have a customer form in two date fields. Actually i find the days between in customer_birthday date and customer_marriage date. i'll try this code to fulfill my problem but its doesn't work.
  where i am wrong.</p>
  
  <p><strong>My controller code</strong></p>
  
  <pre><code>$date1=$_POST['customer_birth'];
  $date2=$_POST['customer_marriage'];
  $datediff = $date1 - $date2;
  echo floor($datediff / (60 * 60 * 24)); exit ;
  </code></pre>
  
  <p>its gives me output is 0</p>
  
  <p>thanks for help</p>