$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
Email Verification Confirmation Using PHP Codeigniter
Below is a simple program which shows email verification confirmation using a unique code, implemented in PHP,Mysql, Codeigniter. PHP Codeigniter Email Verification Step 1 :Create a table as shown below with email_verification_code as necessary column: [mysql] CREATE TABLE `users` ( `user_id` int(10) NOT NULL auto_increment, `first_name` varchar(45) NOT NULL, `last_name` varchar(45) NOT NULL, `email_verification_code` varchar(45) […]
How to Show Errors in PHP
Below script is to show errors in PHP, the error_reporting function will show all the error.You have to initialize at the start of PHP tag.
PHP Mysql Visitor Counter Script
If you want to add a counter to a web page or a website then use the below simple PHP Counter Script using MySql. It is very easy to implement it and it counts whenever a page is being refreshed and the script won’t reduce page speed, unlike page counter scripts. PHP Visitor Counter Script […]