str_replace neden kullanmıyosun?

$resim = '<img src="xxx" width="50" height="150">';

$resim = str_replace(

   array('width="50"','height="150"'),array('width="150"','height="550"'),$resim

);