non ho capito molto da quello che hai scritto ma cmq qui non sostituisce nulla....
$t = str_replace("", "", $t);
$t = str_replace("", "
", $t);