PHP date_parse() Function

Definition

The date_parse() function parses string to get a date.

Syntax

PHP date_parse() Function has the following syntax.

date_parse(date);

Parameter

date - Required. Date in a format accepted by strtotime()

Return

PHP date_parse() Function returns parsed date on success. FALSE on failure.

Example

Parse a string to date


<?php// w  w  w .java  2s  .c om
print_r(date_parse("2013-05-01 12:30:45.5"));
echo "\n";
$time = "00:14:38";
$parse_date = date_parse($time);
echo var_dump($parse_date) ."\n";

?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions