> while $date1 is in "yyyymmdd" format but $date2 is in
> "yyyy-mm-dd" formate because I get value of $date2 from a
> "date" data type field from a table.
Ah, see ... this is what I was talking about with making sure
they are in the same format :)
> Can I use this "yyyy-mm-dd" to compare with value from
> another date variabile in the "yyyymmdd" format? If not
> possible, How do I make both of them to be in the same format?
You can change yyyy-mm-dd to yyyymmdd like this:
$withoutdashes = ereg_replace("[^0-9]", "", $withdashes);
This wil actually remove everything from the string that is
not a number between 0 and 9 (ie, numbers).
Jason
--
Jason Murray
[EMAIL PROTECTED]
Web Design Team, Melbourne IT
Fetch the comfy chair!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]