$startDate = "20150624";
$endDate = "20150722";
$startDate = strtotime($startDate);
$endDate = strtotime($endDate);
$dayLength = 60 * 60 * 24;
$checkDateRange = ($endDate - $startDate) / $dayLength;
$datesStartMonth = date('t', $startDate);
if ($checkDateRange > $datesStartMonth) {
echo $error = "Date range should be with in one month";
}
Related Articles
How to Set Iframe Height to 100%
Use below snippet to set height of an iframe to 100%, however we can also set width of ifram to 100% also. <iframe src=”http://domain.com” frameborder=”0″></iframe> iframe { display:block; width:100%; height:100vh; }
How to ini_set in PHP
You can initilize local settings in a php file.You can set values like max_execution_time, default_socket_timeout, memory_limit, mysql.connect_timeout, user_ini.cache_ttl, display_errors and log_errorsit always nice to check the errors in PHP files with error_reporting. Below is the sample script to set ini_set values. If you dont want to set every time in PHP script simply set the […]
How to Create Ical File to Work on Outlook, Google Calendar and Mac Icalendar
To Create Ical files we need to follow some standards set by ietf.org. Below are the working copies of the sample ical files created and these are tested on Outlook calendar, Google Calendar, Mac Icalendar, and Thunder Bird Calendar with Lightning plugin. How to Create Ical File Contents show 1. How to Create Ical File […]