non sono molto pratico mi dareste un esempio?
ho provato:
Codice PHP:
ereg_replace( ' +', ' ', $input );
---
function trimall($str, $charlist = " \t\n\r\0\x0B")
{
return str_replace(str_split($charlist), '', $str);
}
---
function strTrimTotal($input) {
$input = trim($input);
for($i=0;$i<strlen($input);$i++) {
if(substr($input, $i, 1) != " ") {
$output .= trim(substr($input, $i, 1));
} else {
$output .= " ";
}
}
return $output;
}
----
function removeWhitespace($string)
{
if (!is_string($string))
return false;
$string = preg_quote($string, '|');
return preg_replace('| +|', ' ', $string);
}
----
function trimlrm ($hayStack, $whiteSpaceChars)
{
$char = $whiteSpaceChars[0];
$chars = str_repeat($char, strlen($whiteSpaceChars);
$trimmed = strtr($hayStack, $whiteSpaceChars, $chars)));
return str_replace($char, '', $trimmed);
}
ma niente
grazie