Trim only tab and newline characters from $str : String Trim Chop « String « PHP






Trim only tab and newline characters from $str

<?

$str = "   string \t \n";

$str = trim ($str, "\t\n");

echo( $str );

echo(strlen($str));

?>

           
       








Related examples in the same category

1.Trimming Strings: ltrim
2.Trimming Strings: trim
3.Trimming Strings for 'tab' and 'return'
4.Specify the characters in charlist by giving their hexadecimal value
5.String trim chop and length