function fp_reduce_whitespace

7.x misc.inc fp_reduce_whitespace($str)
6.x misc.inc fp_reduce_whitespace($str)
4.x misc.inc fp_reduce_whitespace($str)
5.x misc.inc fp_reduce_whitespace($str)

Simple helper function to reduce whitespace (like double-spaces)

Parameters

string $str:

7 calls to fp_reduce_whitespace()
advise_popup_display_summary in modules/advise/advise.history.inc
Displays the printable advising summary.
AdvisingScreen::display_popup_substitute in classes/AdvisingScreen.php
This is used to display the substitution popup to a user, to let them actually make a substitution.
fp_get_js_alert_link in includes/misc.inc
Creates a javascript "alert" link, which tells the user some message with javascript alert().
fp_get_js_confirm_link in includes/misc.inc
Creates a javascript "confirm" link, so when clicked it asks the user a question, then proceeds if they select OK. The main reason I want to do this is so I can pass the $question through my t() function. (do it when you call this function)
fp_get_js_prompt_link in includes/misc.inc
Creates a javascript "prompt" link, which will ask the user a question.

... See full list

File

includes/misc.inc, line 2903
This file contains misc functions for FlightPath

Code

function fp_reduce_whitespace($str) {
  // Cheap hack to get rid of whitespace    
  for ($t = 0; $t < 5; $t++) {
    $str = str_replace("  ", " ", $str);
    $str = str_replace("\n ", "\n", $str);
  }



  return $str;
}