This makes NO SENSE!!!!!
| From: | Chris Cocuzzo | Date: | Thu, 27 Dec 2001 08:17:42 +0000 |
| Subject: | This makes NO SENSE!!!!! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78823@lists.php.net to get a copy of this message | ||
hey-
ok. I have the following code.
<?php
if($submit) {
$arradate = explode("/",$date);
$uxdate = mktime(0,0,0,$arradate[0],$arradate[1],$arradate[2]);
print $uxdate;
}
else {
?>
<form action="strtotime.php" method="POST"> //name of file is
strtotime.php
<input type="text" name="date" size="30">
<input type="submit" name="submit" value="submit">
<?
}
?>
the problem: it's printing out -1 when i submit. I know it means something
is wrong, however I can't find an error with this when i have the following
code below working perfectly: [sidenote]: i enter the date into the form
field like this: 1/11/2002
$date1 = "1/11/2002";
$ardate = explode("/",$date1);
$unixdate = mktime(0,0,0,$ardate[0],$ardate[1],$ardate[2]);
print $unixdate . "<br>";
can somebody explain to me why this isn't working??
thanks
chris
p.s. it should return this unix timestamp: 1010725200