How to Add Google Map in PHP?

Feb 08, 2022 . Admin

Hello Friends,

I am going to explain you example of how to add google map in PHP. You will learn how to add google map using PHP. In side this article we will see the how to insert google map in PHP.

This article will give you simple example of how to add map in PHP. We will use how to add google map in PHP website.

Here i will give you many example of how to add google map in PHP project.

So, let's see bellow solution:

index.php
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>How To Add Google Map in PHP - Mywebtuts.com</title>
    </head>
    <body>
        <h2>How To Add Google Map in php</h2>
        <div id="myMap" style="width:100%;height:500px;"></div>
        <script>
            function myMap() {
                var mapProp= {
                  center:new google.maps.LatLng(20.5937,78.9629),
                  zoom:4,
                };
                var map = new google.maps.Map(document.getElementById("myMap"),mapProp);
            }
        </script>
        <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBGyf3q49wWInEjM_6PL5wYYX3MaC8dswA&callback=myMap"></script>
    </body>
</html>
Output:

It will help you...
#PHP