lundi 17 novembre 2014

Create date string using PHP variable


Vote count:

0




I want to create a date using variable.



<?php
$var_day = "31";
$var_month = "01";
$var_year = "2011";
$var_date = $var_day."-".$var_month."-".$var_year;
echo $var_date;
?>


Output: -1981


But i want to print "31-01-2011". How can i do this? And what is the problem in it?



asked 45 secs ago

anik4e

200






Create date string using PHP variable

Aucun commentaire:

Enregistrer un commentaire