You are here: Re: strip flashvar from a flash? « All PHP « IT news, forums, messages
Re: strip flashvar from a flash?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация