I am trying to match some of the Javascript on a Youtube video page. The pattern thats the same for every video is like this:
<param name=\"flashvars\" value=\"somethingsomethingsomething\">
I need to get out everything in value
, in this case somethingsomethingsomething
. It is commented out because this is embedded in Javascript. This is the code I'm using:
preg_match('<param name=\\"flashvars\\" value=\\"(.*)\\">', $ytPage, $match);
$ytPage
is the source code of the youtube page. But when I run the code $matches
never returns a match.
Is there something I'm, doing wrong? Or perhaps someone could perpose a better way of doing what I want.
Thanks.