I have an application where users can post their own html banner code for exchanges. The problem is that I need to check their "height" and "width" dimensions if they exceed what I've defined.
Say the html they pasted looks like this and now resides in a variable titled "$bancode":
<a href="http://www.theirsite.com"><img src="http://www.theirsite.com/banners/banner.gif" alt="MySite" height="100" width="750" border="0"></a>
Based on this, I've pulled the image url, and have calculated new height and width dimensions.
The problem is, that I don't know how to replace the old dimensions with the new. I want to make sure that it's not case sensitive, and not expecting that width always follows height, etc.
I've poked around the forums and was able to solve the extraction of the image url, but I'm stuck on this pattern replacement.
Any help is very much appreicated.
Regards,
Tim