Using Simple HTML Dom to match a string on the page
How do I match and get the flash vars on a HTML page? I am using simple HTML dom element and I am able to narrow down to a div containing the text I need.
<script type="text/javascript">
var s1 = new SWFObject("jw4.4/player.swf", "player", "400", "50", "9");
s1.addParam("allowfullscreen", "true");
s1.addParam('allowscriptaccess','always');
s1.addVariable("width","400");
s1.addVariable("height","50");
s1.addVariable("overstretch", "false");
s1.addParam('flashvars',"this_id=/tg&autostart=true");
s1.write("container");
How do I get the value of this_id, so I want to return /tg
? What would I put in fin开发者_运维知识库d? Or do i have to use something else?
$html = file_get_html("$url");
$file_path = $html->find('this_id=/');
Thanks all for any help
i think thats better done with a regex - simpledom would have you find('param'); and than you have to loop through the result looking for where strpos( $elem->flashvar, 'this_id=/' ) !== false.
regex would be /this_id=/([^&]+?)&/
精彩评论