PHP date_get_last_errors() Function
In this chapter you will learn:
- Definition for PHP date_get_last_errors() Function
- Syntax for PHP date_get_last_errors() Function
- Return value from PHP date_get_last_errors() Function
- Example - return the warnings and errors while parsing a date string
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.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP date_interval_format() Function
- Syntax for PHP date_interval_format() Function
- Parameter for PHP date_interval_format() Function
- Note for PHP date_interval_format() Function
- Return value from PHP date_interval_format() Function
- Example - Calculate the interval between two dates, then format the interval
Home » PHP Tutorial » PHP Date Functions