29 November 2012

Remove width and height attributes from img tag using PHP. Really plain and simple replace width and height attributes with nothing.

Source code viewer
  1. echo preg_replace('/(width|height)="[0-9]*"/i', '', $str);
Programming Language: PHP