get the timestamps of both dates (use time() for now and strtotime() for literal dates)
subtract the smaller one from the other one > your result is the difference in seconds
now divide this diff. by (246060) (seconds per day) and the result should be the diff in days