this is driving me mad!
I have the following code:
function removeEmptyLines($string)
{
$string = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n", $string);
$string = preg_replace("/^[\s\t]*[\r\n]+/", "", $string);
$string = preg_replace("/^[\s\t]*[\s\t]+/", "", $string);
return $string;
}
my string may be
" hello "
when I export the file - the tabbed spaces are replaced by squares..
the above example would come out as
[][][]hello[][][]
I cannot get the above code to remove the tabs from the end of the string - they are removed from the beginning, but not the end!
thanks for any help!