![](/img/trans.png)
[英]How to convert Birth date to age ( years, months, days ) and age( years, months, days ) to birth date conversion in PHP?
[英]Separated by years, months, days of the date
如何區分年、月、日。 並且每個都放入變量?
1390/02/05
$year = '1390';
$month = '02';
$day = '05';
尊重地
就像是:
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);
你可以這樣做:
$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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.