In this article, you will learn how to get detailed information about the date according to the specified format. The date_parse() function returns an associative array containing detailed information such as Day, Month, Year, Hours, Minutes, Seconds, locale, and some other parameters from the specified date in a specified format.
What is the syntax of the date_parse_from_format() function in PHP?
date_parse_from_format(format, date)
Parameter | Description |
---|---|
format | Format to parse – Required |
date | The date as a string – Required |
Examples of the date_parse_from_format() function
Example 1. In the following example, we specify the ddmmyyy format and the date to parse it using the function.
<?php
print_r(date_parse_from_format("ddmmyyyy","01522014"));
?>