i need to extract a value (id value) from html web page . this value
is included in JavaScript code .
<script type="text/JavaScript">
var geoInstance = gioFinder("geo");
geoInstance.setup({
id: "126568949", // i need this
geometre: "triangle",
type: "html",
image: 'https://example/126568949.jpg',
});
</script>
my code php is
<?php
$filename = "https://examlpe.com";
$handle = fopen($filename, "r");
if ($handle) {
while (!feof($handle)) {
$text. = fread($handle, 128);
}
fclose($handle);
}
// How can you do
//right answer is .
$result = preg_match('/(?<=id: ")(.*)(?=",)/', $text, $matches);
echo $matches[0];
//end
?>
idproperty in thisgeoInstanceparameter? This question could use a bit of clarity.