By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,623 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

unexpecting result with my code

P: 22
what's wrong with mycode i cant get what i hope appears
thanks to help me
[PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<?php
$date="20";
$month="02";
$year="2007";
$dt="$year$month$date";
$t1=date($dt);
$t2=date("d",$t1);
$t3=date("F",$t1);
$t4=date("Y",$t1);
echo"$t2";
echo"$t3";
echo"$t4";
//attempt to get 20 February 2007
?>
<body>
</body>
</html>[/PHP]
Feb 19 '07 #1
Share this Question
Share on Google+
2 Replies


cassbiz
100+
P: 202
Try this snippet

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $date="20";
  4. $month="2";
  5. $year="2007";
  6.  
  7. $timestamp = mktime(0,0,0, $month, $date, $year);
  8.  
  9. //attempt to get 20 February 2007
  10. echo date('d F Y', $timestamp);
  11.  
  12. ?>
  13.  
Good Luck with your project
Feb 19 '07 #2

P: 22
thanks it works
Mar 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.