/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function resizeMarkup($markup, $dimensions) { $w = $dimensions['width']; $h = $dimensions['height']; { $patterns[] = '/width="([0-9]+)"/'; $patterns[] = '/width:([0-9]+)/'; $replacements[] = 'width="'.$w.'"'; $replacements[] = 'width:'.$w; } { $patterns[] = '/height="([0-9]+)"/'; $patterns[] = '/height:([0-9]+)/'; $replacements[] = 'height="'.$h.'"'; $replacements[] = 'height:'.$h; } }
URL: http://ennuidesign.com/blog/ITT+%237%3A+Dynamically+Change+Width+and+Height+in+HTML+Markup/
Comments
