How to find out difference betwwen dates in php

Status
Not open for further replies.

vipink

Junior Member
Aug 5, 2015
21
0
0
Guys i was coding an rental management for my friend .while selecting each renter's view page it display renter full detail in on table , payed_date and payed_rent amount detail and total of remaining amount he payed.But the problem is that while entering payed_date and payed_rent amount twice in one month the payed amount substract twice from rent_date.how can i rectify this problem in php coding skill.please find any way
 

xhtmljunkies123

Junior Member
Aug 19, 2015
7
0
16
Using the identical (===) comparision operator in different but equal objects will return false

<?php
$c = new DateTime( '2014-04-20' );
$d = new DateTime( '2014-04-20' );
var_dump( $d === $d ); #true
var_dump( $d === $c ); #false
var_dump( $d == $c ); #true
?>
 

purbeast0

No Lifer
Sep 13, 2001
53,575
6,408
126
no offense, but if you don't know how to compare dates or how to figure that out yourself without asking people for help, you probably should not be coding a rental management system.
 

Graze

Senior member
Nov 27, 2012
468
1
0
no offense, but if you don't know how to compare dates or how to figure that out yourself without asking people for help, you probably should not be coding a rental management system.

I am with you on this one. There are so many existing resources on the net that could provide this answer with a simple google search.
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,656
4,595
75
This isn't a long-term necro, but it's close enough, with no response from the OP, that I'm gonna close this thread. -- Programming Moderator Ken g6
 
Status
Not open for further replies.