Equivalent date functions in PHP ?
Hi there,
Got another question about PHP. I've succeeded in converting most of my ASP functions to PHP, but I don't understand quite well how date works.
Suppose i have a string, say $strTmp = '2002-01-12', how can i tell PHP this is a date ( Like CDate() ) and then extract month, day, year from it ?
Thanks in advance !
Re: Equivalent date functions in PHP ?
Quote:
Originally posted by eL_NiNo
Hi there,
Got another question about PHP. I've succeeded in converting most of my ASP functions to PHP, but I don't understand quite well how date works.
Suppose i have a string, say $strTmp = '2002-01-12', how can i tell PHP this is a date ( Like CDate() ) and then extract month, day, year from it ?
Thanks in advance !
The PHP documentation can be a valuable resource: http://www.php.net/
You can find information on the date function here: http://www.php.net/manual/en/function.date.php
As for telling PHP it's a date, that doesn't matter. There aren't specified variable types in PHP. Just as long as it's the right format for date, PHP will recognize it.