I am able to remove all single tabs from a string:
// Copying and pasting the tab directly
$txt = str_replace(\" \", \"\", $txt);
This only
trim(preg_replace('/\t+/', '', $string))
Try using this regular expression
$string = trim(preg_replace('/\t/g', '', $string));
This will trim out all tabs from the string ...
trim(preg_replace('/[\t|\s{2,}]/', '', $result))
Removes all tabs, including tabs created with multiple spaces
this will remove all tabs in your variable $string
preg_replace('/\s+/', '', $string);
$string = trim(preg_replace('/\t/', '', $string));
This works for me. Remove the g
of @Mr. Aliens answer.