Jump to content

Pulling object tags


fizix

Recommended Posts

Alright, I've created a preg_match expression that returns all object tags in a string. However, I now need to return all the object tags that DO NOT have a semicolon somewhere in them. Could anybody tell me why this isn't working?

 

$test = preg_match_all('/<object(.*?)(?!\<\/object>/ims', $contents, $found);

 

Thanks!

Link to comment
Share on other sites

Ok, say I'm trying to pull tags from the source of

. When doing a print_r on $found I get:

 

Array
(
   [0] => Array
       (
           [0] => <object width='728' height='90'>";
		url += "<" + "param value='clickTAG=" + encodeURIComponent(ref_url) + "' /" + ">";
		url += "<" + "embed src='" + img_url + "'";
		url += " type='application/x-shockwave-flash' wmode='transparent'";
		url += " flashvars='clickTAG=" + encodeURIComponent(ref_url) + "'";
		url += " width='728' height='90' /" + ">";
		url += "</object>
           [1] => <object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/Ee_8IMx0uMo"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/Ee_8IMx0uMo" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
       )

)

 

However, I only want to get the result in $found[0][1], not $found[0][0]. I want to filter it out by excluding strings with semicolons [;] from the results.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.