Another Newbie question
Posted: Sat Oct 21, 2006 5:14 pm
Hi,
Really quick question. I am trying to write a php script that takes the current date and displays the next day's date. I know how to have php display the current date but how do I manipulate this date. originally I had tried:
<?php
echo date("m.d+1.Y");
?>
but that did not work (I'll admit I did not think it would).
Second question, when php looks at the date function, how does it interpret it? For example let's say I wanted to test if today's date was a certain date so I wrote: an if statment comparing a given string to the current date. This does not work (I tried) so what would need to be done?
example:
$currentDate= date("m.d.Y");
$date = 08.09.2006;
if ($currentDate==$date)
.
.
.
This does not work. I am assuming because the date function returns a different type that cannot be compared to a numeric string. I thought I would try to unserialize the date ($currentDate) (but that did not work: which does not surprise me since I really don't quite get the unserialize concept.
Thanks in advance for any advice given and expanations rendered.
Dag
Really quick question. I am trying to write a php script that takes the current date and displays the next day's date. I know how to have php display the current date but how do I manipulate this date. originally I had tried:
<?php
echo date("m.d+1.Y");
?>
but that did not work (I'll admit I did not think it would).
Second question, when php looks at the date function, how does it interpret it? For example let's say I wanted to test if today's date was a certain date so I wrote: an if statment comparing a given string to the current date. This does not work (I tried) so what would need to be done?
example:
$currentDate= date("m.d.Y");
$date = 08.09.2006;
if ($currentDate==$date)
.
.
.
This does not work. I am assuming because the date function returns a different type that cannot be compared to a numeric string. I thought I would try to unserialize the date ($currentDate) (but that did not work: which does not surprise me since I really don't quite get the unserialize concept.
Thanks in advance for any advice given and expanations rendered.
Dag