I've never had occasion to use DOMDocument before but here goes:
This pulls out the link sans query vars on the end like '&color1=0xe1600f'
and echo's this:
<?php
$s = '<object width="320" height="265"><param name="movie" value="http://www.youtube.com/v/ZuwP5C-1jJU&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZuwP5C-1jJU&hl=en_US&fs=1&rel=0&color1=0xe1600f&color2=0xfebd01" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="320" height="265"></embed></object>?>';
$doc = new DOMDocument();
$doc->loadHTML($s);
foreach($doc->getElementsByTagName('param') as $obj) {
$name = $obj->getAttribute('name');
if($name == 'movie') {
$url = $obj->getAttribute('value');
}
}
$endpos = strpos($url,'?');
if($endpos === false) {
$endpos = strpos($url,'&');
}
echo substr($url,0,$endpos);
?>