$ data(HTML Response):
...
<script type="text/javascript">
//<![CDATA[
WebForm_AutoFocus('drpDwnLstLinhas');Sys.Application.add_init(function() {
$create(Artem.Google.MarkersBehavior, {"markerOptions":..EXTENSIVE JSON..,"name":"map_GoogleMarkers"}, null, null, $get("map"));
});
//]]>
</script>
...
我想提取:{"markerOptions":..EXTENSIVE JSON..,"name":"map_GoogleMarkers"}
代码:
preg_match('~$create(Artem.Google.MarkersBehavior, (.*?), null, null, $get("map"));~', $data, $json);
var_dump($json); //empty
答案 0 :(得分:1)
你只需要逃避“$”和“(”和“)”
preg_match('~\$create\(Artem.Google.MarkersBehavior, (.*), null, null, \$get\("map"\)\);~', $data, $json);
测试。