$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 Get Source Code of a Web Page
If you are looking for How to Get Source Code of a Web Page or link then just follow below steps. How To Find A Web Page’s Source Code it easy? Source Code of a Web Page Contents show 1. Source Code of a Web Page 2. Source Code of a Web Page in PHP […]
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 […]
PHP Magic Constants __LINE__ __FILE__ __DIR__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__
Below are the list of PHP predefined Magic Constants PHP Magic Constants Name Description __LINE__ The current line number of the file. __FILE__ The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned. __DIR__ The directory of the file. If used […]