Date question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
th3monk3y
Forum Commoner
Posts: 29
Joined: Thu Jun 19, 2003 10:34 pm

Date question

Post 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
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

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


This should be really basic stuff even for a newbie :)
th3monk3y
Forum Commoner
Posts: 29
Joined: Thu Jun 19, 2003 10:34 pm

Post 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
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post 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
Post Reply