Mega Code Archive

 
Categories / Php / Strings
 

Replacing Tabs with Spaces

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