Guest User

Untitled

a guest
Sep 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1.  
  2. /**
  3.  * Clears any empty line within the input string. Output data as merged string with empty lines stripped out.
  4.  @param $nfoData string the input string
  5.  */
  6. function clear_nfo_empty_lines($nfoData) {
  7.     $lines = explode("\n", $nfoData);
  8.     $mergedString = "";
  9.     foreach($lines as $line) {
  10.         if(strlen(trim($line)) == 0)
  11.             continue;
  12.         $mergedString += $line + "\n";
  13.     }
  14.     return $mergedString;
  15. }
Add Comment
Please, Sign In to add comment