Comment detail
n日後を返す関数を返す関数 (Nested Flatten)
できますよ。create_functionを使います。
1 2 3 4 5 6 7 8 9 10 11 12 | function n_days_later($days) {
return create_function('$d',
'return getdate(mktime(
$d["hours"], $d["minutes"], $d["seconds"], $d["mon"],
$d["mday"] + '. $days . ', $d["year"]
));');
}
$five_days_later = n_days_later(5);
$date = $five_days_later(getdate());
print_r($date);
|





匿名
#1300()
[
PHP
]
Rating0/0=0.00
Rating0/0=0.00-0+
1 reply [ reply ]