Skip to content

Instantly share code, notes, and snippets.

@devster
Last active December 30, 2015 21:29
Show Gist options
  • Save devster/7888116 to your computer and use it in GitHub Desktop.
Save devster/7888116 to your computer and use it in GitHub Desktop.
Trim all blank chars from a string
<?php
$str = " Hello world
";
echo trim($str, " \t\n\r\0\x0B"); // will echo "Hello World"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment