Loganathan Natarajan
asked on
How do I match and retrieve the EMBED tag from the html source
I have html source contains embed tag and want to retrieve only that, for example the below html source, how can i retrieve embed tag ? i need with preg match ...
i am trying like this, but does not work,
echo preg_match('<embed.+="(.+? )".+?<\/em bed>',$res ult);
i am trying like this, but does not work,
echo preg_match('<embed.+="(.+?
<div class="test">
<embed src='http://www.saynow.com/flash/test.swf' quality="high" FlashVars="itemId=test&autoplay=0&duration=04:05&url=http://my.saynow.com" bgcolor="#ffffff" wmode="opaque" width="320" height="65" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
</div>
http://php.net/manual/en/function.strpos.php
the src need not be the first attribute. if the string changes to <embed name="" src = "" /> your match may not work properly. even the src may miss in the embed tag by mistake!
the src need not be the first attribute. if the string changes to <embed name="" src = "" /> your match may not work properly. even the src may miss in the embed tag by mistake!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
great!! works now i was there. but some syntax error
and download the file thru php.