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
https://forums.phpfreaks.com/topic/53084-pulling-object-tags/
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
https://forums.phpfreaks.com/topic/53084-pulling-object-tags/#findComment-262717
Share on other sites

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.