The below URL of Google Calender helps us create an event in google calendar.
https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20220112T180000Z%2F20220112T200000Z&details=My First going to happend at Mumbai&location=Mumbai&text=Welcome to My First EventLet me explain the parameter pass in this URL:
Parameter
<!DOCTYPE html>
<html>
<body>
<a href="https://calendar.google.com/calendar/render?action=TEMPLATE&dates=20220112T180000Z%2F20220112T200000Z&details=My First going to happend at Mumbai&location=Mumbai&text=Welcome to My First Event" target="_blank" style="color: blue; text-decoration: underline;">Add to Google</a>
</body>
</html>
By clicking on the URL it will redirect to the google calendar page if you are on the web and if you are mobile device then it redirects to the calendar app of google.
In PHP instead of hardcoding you have to pass the data dynamically to the parameter.
<!DOCTYPE html>
<html>
<body>
<a href="https://calendar.google.com/calendar/render?action=TEMPLATE&dates=$dates&details=$details&location=$location&text=$title" target="_blank" style="color: blue; text-decoration: underline;">Add to Google</a>
</body>
</html>