Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<?php
echo '<script src="https://maps.googleapis.com/maps/api/js"></script>';
echo '<script type="text/javascript">
function initialize() {
var position = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 10,
center: position,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(
document.getElementById("your_map_canvas"),
myOptions);
var marker = new google.maps.Marker({
position: position,
map: map,
title:"Your title"
});
var contentString = "xyz content string";
var infowindow = new google.maps.InfoWindow({
content: contentString
});
google.maps.event.addListener(marker,"click", function() {
infowindow.open(map,marker);
});
}
google.maps.event.addDomListener(window, "load", initialize);
</script>';
?>
</head>
<body>
<div id="your_map_canvas" style="width:600px; height:600px"></div>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP Click to see more ... 4.6K 408