Search
 
SCRIPT & CODE EXAMPLE
 

PHP

check date php

function validateDate($date, $format = 'Y-m-d')
{
    $d = DateTime::createFromFormat($format, $date);
    // The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.
    return $d && $d->format($format) === $date;
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel validation custom message 
Php :: how to include file in laravel blade 
Php :: php date in italiano 
Php :: wp reserved image size name 
Php :: model find by certain column laravel 
Php :: create model laravel 
Php :: explode example in php 
Php :: php-fpm docker 
Php :: php function uppercase first letter 
Php :: specification migration laravel 
Php :: laravel compare date timestamp 
Php :: wc php if is product category page 
Php :: laravel collection average 
Php :: throttle laravel 
Php :: check if checkbox is not checked laravel 8 
Php :: php reverse dns lookup 
Php :: location php ini mac os 
Php :: on running php file showing code instead of view 
Php :: php lowercase assoc array 
Php :: carbon between hours 
Php :: Installing Maatwebsite excel import export package 
Php :: php merge array with same value 
Php :: wc create new category 
Php :: laravel force login by id 
Php :: symlink.php laravel 
Php :: return only one column data from table in codeigniter 
Php :: wordpress enqueue js 
Php :: php static variable 
Php :: Set a minimum subtotal amount in Woocommerce cart 
Php :: text box should accept only alphanumeric not special characters in php 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =