one of the problems that i was facing was time and date difference in PHP and saw here are many users that they want date difference between 2 date so in tutorial i'm going to show how to get days between 2 date.
i am using PHP 5+ and the following function please read these function before reading this tutorial.

gregoriantojd
Parameters:month Month of the Yearday Day of the Monthyear Year

explode
explode use for array to create an array of given value or string
example:

$explod = explode(" ","this is a sample text");
echo $explod[3];//our put sample
//or we can use an loop for printing value of array

separator a string separator value exmaple "/" or "-" or " " or any thing you wantstring the string value to search and cut by separator valuelimitoptional maximum length

ok lets start:
here i am changing the date format for gregoriantojd, because i'm using "dd-mm-yyyy" format in my example and if we explode it, the value of array changing to (0) for day, (1) for month, (2) for year and gregoriantojd is asking first for month, day and year.