In short change contineous occurance of the string value that we specify, with a single string value. ie
hello \t\t\t\t\t world
\t\t\t
to
hello \t world
\t
In detail
\tExample
to
understand
the current
situatuion\t\t\t\t\t.
i wanted the output as
Example
to
understand
the current
situation .
output in html
<br /> Example<br />to <br />understand<br /> the current<br /> situation .
and i managed to get this output
Example
to
understand
the current
situatuion .
with this code
$str='
\tExample
to
understand
the current
situatuion\t\t\t\t\t.';
echo str_replace(array('
', '','\t','<br /><br />' ),
array('<br />', '<br />',' ','<br />'),
$str);