$image = preg_replace('~<img\s+src="([^"]+)"([^/>]+)/>~i', '<img src="$1"$2width="350px" />', $image);