PHP Tutorial - PHP date_get_last_errors() Function






Definition

The date_get_last_errors() function returns the warnings/errors found while parsing a date string.

Syntax

PHP date_get_last_errors() Function has the following syntax.

date_get_last_errors();

Return

PHP date_get_last_errors() Function returns an array that contains information about the errors/warnings.

Example

Get the warnings and errors while parsing a date string


<?php
date_create("asdfasdfasdfa");
print_r(date_get_last_errors());
?>

The code above generates the following result.