Skip to content

Instantly share code, notes, and snippets.

@AlexMcowkin
Last active August 29, 2015 14:18
Show Gist options
  • Save AlexMcowkin/74107654818aaa154cd7 to your computer and use it in GitHub Desktop.
Save AlexMcowkin/74107654818aaa154cd7 to your computer and use it in GitHub Desktop.
PHP remove line breaks and tabulation
<?php
// remove line breaks
$_descr = str_replace(array("\r\n", "\r", "\n"), "", $_descr);
// remove tabulation
$_descr = preg_replace('/\t+/', '', $_descr);
// $xmlString = rtrim($xmlString, "\r\n");
// $xmlString = rtrim($xmlString, "\r");
// $xmlString = rtrim($xmlString, "\n");
// $xmlString = rtrim($xmlString, "\0");
// $xmlString = rtrim($xmlString, "\t");
// $xmlString = rtrim($xmlString, "\x0B");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment