Skip to content

Instantly share code, notes, and snippets.

@Fayozjon
Created May 22, 2018 07:23
Show Gist options
  • Save Fayozjon/fdfa6a04dccda3265902dd3ee86632fc to your computer and use it in GitHub Desktop.
Save Fayozjon/fdfa6a04dccda3265902dd3ee86632fc to your computer and use it in GitHub Desktop.
$re = '/var mapLatlng = new google.maps.LatLng\((.*)\);*$/m';
$str = '<script type="text/javascript">
function initialize() {
var mapLatlng = new google.maps.LatLng(39.6589, 66.9794);
var mapOptions = {
zoom: 15,
center: mapLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false
};
var map = new google.maps.Map(document.getElementById("map2"), mapOptions);
var marker = new google.maps.Marker({
position: mapLatlng,
map: map,
title:"Sangzor"
});
}
jQuery(document).ready(function(){initialize();});
</script>';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment