PHP date from string

PHP date from string


Posted in : PHP Posted on : January 24, 2011 at 7:05 PM Comments : [ 0 ]

In this tutorial you will learn how to find PHP date from string in a PHP web application.

PHP date from string

In this tutorial you will learn how to find PHP date from string in a PHP web application. In this tutorial $date_string variable use for assign date as string format and strtotime() function use for convert English textual description into a Unix timestamp . The code of "php-date-from-string.php" given below as : 

<?php
$date_string = "2 Oct 2010 12:00:00";
echo "Date :: ".$date_string."<br>";
echo " Date from string :: ".date('Y-m-d',strtotime($date_string));
?>

Output :

When run "php-date-from-string.php" display output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics