Removing all class tags in HTML by preg_replace is super easy.

$ret = preg_replace("/ class=\".*?\"/", "", $resp);