<?php

$string = "This is a test id=abc> string";
$replace = preg_replace('/=([\w]+)/i', '="$1"', $string );

echo $replace ;