Jump to content

get parameter from url


tyra

Recommended Posts

Hi!

 

$url = "http://www.youtube.com/watch?feature=player_embedded&v=IwPHy17Iu6E";

I have code   

if (preg_match("/http:\/\/www.youtube.com\/watch\?v=([0-9a-zA-Z-_]*)(.*)/i", $url, $matches)) {
        return '<object height="'.$embed_height.'" width="'.$embed_width.'">'.
               '<param name="movie" value="http://www.youtube.com/v/'.$matches[1].'" />'.
               '<param name="wmode" value="transparent" />'.
               '<embed src="http://www.youtube.com/v/'.$matches[1].'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" height="'.$embed_height.'" width="'.$embed_width.'" />'.
               '</object>';

    }

How to remove feature=player_embedded& from $url ?

Link to comment
https://forums.phpfreaks.com/topic/258795-get-parameter-from-url/
Share on other sites

Take a look at this script I wrote to embed multiple youtube videos from within a bunch of text.

It will handle the shortened youtube.be urls.

I have it fetch the video data from youtube's api also.

Fullscreen works.

 

http://www.phpfreaks.com/forums/index.php?topic=342974.msg1619535#msg1619535

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.