Hi, I need a reg expression to change IMG, IFRAME, Flash OBJECT and other HTML TAGS width and height... This does not seem to be working: preg_replace('/<img.*src="(.*?)".*\/?>/', '<img src="\1" width="300px" height="*" />', $txtText); PHP: preg_replace('/<iframe.*src="(.*?)".*\/?>/', '<iframe width="300px" height="*" frameBorder="0" src="\1"></iframe>', $txtText); PHP: Flash Object?! PHP: Could you please help me?
This problem would be much easier solved using JavaScript. Using the jQuery library you could simply do $("img").css("width", "300px"); etc etc. This way the client will process it which will take the processing off your servers and will do the job very nicely. Thanks Andrew