i received below code amongst whole lot of html fetch in php, code in script tags. having trouble using preg_match efficiently extract value of hardest27 on line.
so have variable called $html contains whole lot of html contains line below.
$("<input>").attr({name: "levelreached", value: "hardest27" }).appendto(newform);
how can php return me value of levelreached?
you may try regex on content:
"levelreached"\s*,\s*value:\s*"([^"]*)" group 1 contains expected value.
preg_match_all($re, $html, $matches); foreach($matches[1] $matchgroup) echo $matchgroup."\n";
Comments
Post a Comment