Page 1 of 1

Date question

Posted: Sat Dec 27, 2003 6:57 pm
by th3monk3y
Hi All,
php newbie here!

I have a form with three dropdowns (month) (day) (year)
I am submitting it to a seperate page to process it...

I am trying to get one value out of the three variables (mySql date format yyyy-mm-dd) Here is what i have .. obviously it is doing the math... heh heh...

$actualdate = $fromYear-$fromMonth-$fromDay;

in perl I would do something like

$actualdate = $fromYear\-$fromMonth\-$fromDay;

so it would ignore the operators. what is the php equivilant?

thanks,
-p

Posted: Sat Dec 27, 2003 8:13 pm
by Gen-ik
$actualdate = $fromYear."-".$fromMonth."-".$fromDay;


This should be really basic stuff even for a newbie :)

Posted: Sat Dec 27, 2003 8:40 pm
by th3monk3y
thanks!

When I say newbie.. this is actually my first attempt at php! I am actually relying on my perl skills! PHP looks like it was spawn from perl...

thanks again!
-Paul

Posted: Sun Dec 28, 2003 1:25 am
by devork
yes there are similarities bw php/perl
php aslo uses PCRE (Perl compatable regular Expressions)
so moving from perl to php is not much headache :D