Don't forget that in cases like the one below, you can use the list() function 
to tighten things up a bit:

$start_date='2007-06-20';
list($start_year, $start_month, $start_day) = explode('-',$start_date);



I prefer using the date functions that some of the other people mentioned and 
only use the string functions to get date info when I have to.

If you use strtotime() or have the date in a serial format already, you can get 
a lot more than just month, day, year out of it using date().  But if all you 
really need is month, day, year then whichever method is easiest to work with.

-TG



= = = Original message = = =

$start_date='2007-06-20';
$parts=explode('-',$start_date);
$start_year = $parts[0];
$start_month = $parts[1];
$start_day = $parts[2];


___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to