I need to find a set of buttons which are displayed underneath each entry of a product on a page (DB driven). I need to pick these buttons up and move them to another place on that product's entry.
An example of the code I need to pick up:
Code: Select all
<a href="javascript:void(window.open('http://www.domainname.com/cgi-bin/full.pl?&sel1&&HOT1000192','','width=690,height=550,scrollbars=yes,resizable=yes'))"><img src="/images/product_details.gif" width="120" height="18" border="0" /></a>
<a href="javascript:void(window.open('http://www.multimap.com/p/browse.cgi?pc=GU46 6JJ','','width=665, height=480,scrollbars=yes,resizable=yes'))" ><img src="/images/local-map.gif" width="120" height="18" border="0" /></a> <a href="javascript:void(window.open('http://www.domainname.com/cgi-bin/plan.pl?hso&sel1&http://www.domainname.com/sel1/&HOT1000192','','width=690,height=550,scrollbars=yes,resizable=yes'))" ><img src="/images/plans.gif" width="120" height="18" border="0" /></a>
</font>Code: Select all
preg_match_all ("/<a href=".'"'."javascript:void(window.open('http:\/\/www. domainname.com\/cgi-bin\/full.pl?&".$agentcode."&&".$matches[0][$i]."','','width=690,height=550,scrollbars=yes,resizable=yes'))".'"><img src="\/images\/product_details.gif" width="120" height="18" border="0" \/><\/a>
<a href="javascript:void(window.open('."'http:\/\/www.multimap.com\/p\/browse.cgi?pc=.*','','width=665, height=480,scrollbars=yes,resizable=yes'))".'" ><img.*<\/font>/Uis', $result, $matchesBUTTONS);Any ideas? At the moment the above regex doesn't produce any results. THanks.