I know how to use getFullYear();
, getMonth();
and getDate();
in JavaScript:
$year = ($hFdate.getFullYear());
$month = ($hFdate.getMonth());
$day = ($hFdate.getDate());
How can I use these functions in PHP?
assuming your $hFdate is a string of date
$hFdate="2018-09-14";
$year = date('Y',strtotime($hFdate));
$month = date('m',strtotime($hFdate));
$year = date('d',strtotime($hFdate));