Jump to content

date format


vj5

Recommended Posts

<?php  $date=explode('/', '02/15/08');  echo date('F dS, Y', mktime(0, 0, 0, $date[0], $date[1], $date[2]));?>

Actually, I don't want to give specific dates like 02/15/08, I gave that for example. All dates are stored in the variable $cdate as 02/15/08 format. So can I replace $cdate in the place where the date such as:
<?php  $date=explode('/', '$cdate');  echo date('F dS, Y', mktime(0, 0, 0, $date[0], $date[1], $date[2]));?>

Link to comment
Share on other sites

' are literal quotes, while " are ... not so literal :) e.g.

$var = "This is a variable";echo '$var'; //Will echo "$var"echo "$var"; //Will echo "This is a variable"

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...