Created
May 22, 2018 07:23
-
-
Save Fayozjon/fdfa6a04dccda3265902dd3ee86632fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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