|
Posted by www.j2be.com on 09/28/08 11:56
"Mike" <doraemon74@gmail.com> ha scritto nel messaggio
news:1156339913.439644.180040@p79g2000cwp.googlegroups.com...
> Hi All,
>
> I'd like to make a php script that strip out just the FlashVars URL
> from the embed code for flash.
>
> For example I've this code:
>
> <embed type="application/x-shockwave-flash"
> src="http://test.com/test.swf" allowScriptAccess="always" width="180px"
> height="23px" bgcolor="#ECECEC" id="player"
> FlashVars="id=0&status=maximize&filepath=http://mywebsite.com/test.xxx&colors=body:#ECECEC;border:#BBBBBB;button:#999999;player_text:#999999;playlist_text:#999999;"></embed>
>
> As final result I'd like to have http://mywebsite.com/test.xxx
>
> I tried with the command preg_replace(), but I can't get to work.
>
>
> Thanks
>
<?php
if(
preg_match("#<embed(.*?)FlashVars=\"(.*?)filepath=(.*?)&(.*?)\"(.*?)</embed>#sUi",$string,$subpatt)
)
{
echo $subpatt[3];
}else { echo "no match... your stuff here"; }
?>
all the other subpattern can be useful to reconstruct the tag if not needed
just remove the parenthesis.
Regards
Leonardo Armando Iarrusso
Navigation:
[Reply to this message]
|