我想获取使用file_get_contents
<script type="text/javascript">
//<![CDATA[
var minFlashVersion = '9,0,124';
var playerWidth = 760;
var playerHeight = 554;
var playerFallbackFile = 'URL';
</script>
我想获取var playerFallbackFile = 'URL';
你能帮我解决一下如何在php中做到这一点吗?
答案 0 :(得分:3)
这:
$data = file_get_contents('http://stackoverflow.com/questions/19236942/');
if (preg_match("/var playerFallbackFile = '(.*?)'/", $data, $match))
{
echo $match[1]; // "URL"
}
else
{
die('playerFallbackFile not found');
}