how can separate year, month, day in date. a开发者_开发百科nd each put in variable?
1390/02/05
$year = '1390';
$month = '02';
$day = '05';
With respect
Something like:
list($year, $month, $day) = explode('/', '1390/02/05', 3);
$timestamp = strtotime('1390/02/05');
$year = date('Y', $timestamp);
$month = date('m', $timestamp);
$day = date('d', $timestamp);
you could do:
$date = '1390/02/05';
$array = $explode('/', $date);
$year = $array[0];
$month = $array[1];
$day = $array[2];
list($year, $month, $day) = explode('/', '1390/02/09', 3);
精彩评论