943,534 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1269
  • PHP RSS
Apr 4th, 2009
0

Extract everything between <object></object>

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
jyotiu is offline Offline
33 posts
since Sep 2008
Apr 4th, 2009
0

Re: Extract everything between <object></object>

Well preg match will do the job. Try the following:
php Syntax (Toggle Plain Text)
  1. <?
  2. preg_match_all('/\<object(.*)\<\/object\>/is',$page_contents,$tmp);
  3. $matches=$tmp[0]; unset($tmp);
  4.  
  5. //display the first one on the page
  6. echo $matches[0];
  7. ?>
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Validating input variables?
Next Thread in PHP Forum Timeline: Online Excel doc in a browser...





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC