Strings Php

$str = "
\tline
\t\tline
\t\t\tline
\t\t}
\t}
";
$replaced = str_replace("\t", '    ', $str);
echo "
{$replaced}
";
?>