reduce_multiples($str[, $character = ''[, $trim = FALSE]])
Parameters:
$str (string) – Text to search in
$character (string) – Character to reduce
$trim (bool) – Whether to also trim the specified character Returns:
Reduced string Return type:
string
Reduces multiple instances of a particular character occuring directly after each other. Example:
$string = "Fred, Bill,, Joe, Jimmy";
$string = reduce_multiples($string,","); //results in "Fred, Bill, Joe, Jimmy"
If the third parame