Specify the characters in charlist by giving their hexadecimal value
<? $str = " string \t \n"; $str = trim ($str, "\0x09\0x0a"); echo( $str ); echo(strlen($str)); ?>