Calculate Days, Month, Years From Date of Birth

$bday = new DateTime($user_birth_date);  // day.month.year (or: year-month-day)
                $now = new DateTime('00:00:00');       // current date-time
               
                $diff = $now->diff($bday);

                $age_year = $diff->y;
                $age_month = $diff->m;
                $age_days = $diff->d;

Set TimeOut in file_get_contents

            $ctx_opts = array('http' => array('timeout' => 10));
            $context = stream_context_create($ctx_opts);
            $response = file_get_contents($URL, false, $context);

            if ($response === false) {
                $error_message = error_get_last();
                echo  $error_message;
            }