I have a problem, i'm a beginnner I have a birthday date (in the format Y-m-d) And I have the actually date.
$date = $_POST["DatumJJJJ"]."-".$_POST["DatumMM"]."-".$_POST["DatumTT"];
$birthday = new DateTime($date);
$now = new DateTime(date("Y-m-d"));
$difference = $birthday->diff($now);
echo $difference;
Now, theres an error in the last line:
Catchable fatal error: Object of class DateInterval could not be converted to string
What should I do? I saw other similar questions but they don't help me!