function fp_reduce_whitespace
Search API
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
unknown_type $str:
3 calls to fp_reduce_whitespace()
- 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.
File
- includes/
misc.inc, line 1447 - 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);
}
return $str;
}