php get month from string datetime
📅 — 👀 52 — 👦$str = '2023-12-05';
if (($timestamp = strtotime($str)) !== false)
{
$yr = date("Y", $timestamp);
$mon = date("m", $timestamp);
$date = date("d", $timestamp);
}
else
{
echo 'invalid timestamp!';
}