- print_r: documentation ( source)
<?php
$date1 = new \DateTime('2024-09-01');
if ($date->format('m') > 9) {
$tax = new \DateTime(($date1->format('Y')+1) . '-09-30');
} else {
$tax = new \DateTime($date1->format('Y') . '-09-30');
}
print_r($tax);