PHP code example of arcanisgk / date-validator
1. Go to this page and download the library: Download arcanisgk/date-validator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arcanisgk / date-validator example snippets
use IcarosNet\DateValidator\DateValidator;
if ($date_validator->ValidateDate('10/10/1999 20:40')) {
echo 'Correct date string';
}
if ($date_validator->ValidateDate('XXX10/10/1999 20:40')) {
echo 'incorrect date string';
}
if($date_validator->addFormat('d--m--Y H%i')->ValidateDate('09--09--2010 20%40')){
echo 'Correct new date format string using % separator';
}
if ($date_validator->ValidateCustomFormatAndDate('09--09--2010','d--m--Y')) {
echo 'Correct date string';
}