I get the content from an URL: http://money18.on.cc/js/real/hk/quote/16981_r.js
The content of this file is something like this:
M18.r_16981 = {
"ltt": '2018/06/21 11:43',
"np": '0.050',
"iep": '0.000',
"iev": '0',
"ltp": '0.050',
"vol": '940000',
"tvr": '49860',
"dyh": '0.060',
"dyl": '0.049'
};
I want to extract the number after "vol", i.e. 940000.
And this is my php:
<?php
$content = file_get_contents("http://money18.on.cc/js/real/hk/quote/16981_r.js");
echo $content."<br>";
preg_match("/(?<=vol\": ').*(?=', \"tvr)/", $content, $output_array);
print_r(array_values($output_array));
?>
The result returns nothing. Is the Regex wrong or any other problem?
Thanks.