Loading Image

Almost there...

Loading Image

Loading...

Remove width and height from tag

This simple PHP function removes the width and height from the supplied string.
18 April 2017 - 10:00
Downloads: 157
Category: PHP
Remove width and height from tag
Overview

This simple PHP function removes the width and height from the supplied string.

PHP Code:
//#################################################################
// REMOVE WIDTH AND HEIGHT ATTRIBUTES
//#################################################################
function removeWidthHeightAttribute($str) {
   $str = preg_replace( '/(width|height)="\d*"\s/', "", $str );
   return $str;
}