Hi all

I am using CURL to reach a page ,now i want to extract this from the page

<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="303.33333333333" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" id="object701207571">
                                <param name="autoPlay" value="false" />
                                <param name="custommode" value="Stage6" />
                                <param name="src" value="" />
                                <param name="movieTitle" value="Titanic" />
                                <param name="bannerEnabled" value="false" />
                                                <param name="previewImage" value="http://stagevu.com/img/thumbnail/oripmqeqzrccbig.jpg" />
                                        <embed type="video/divx" src="" width="640" height="303.33333333333" autoPlay="false" custommode="Stage6" movieTitle="Titanic" bannerEnabled="false" previewImage="http://stagevu.com/img/thumbnail/oripmqeqzrccbig.jpg" pluginspage="http://go.divx.com/plugin/download/" id="embed701207571"></embed>
                        </object>

please help

Well preg match will do the job. Try the following:

<?
preg_match_all('/\<object(.*)\<\/object\>/is',$page_contents,$tmp);
$matches=$tmp[0]; unset($tmp);

//display the first one on the page
echo $matches[0];
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.