Add flag to keep dots

This commit is contained in:
Romain Neutron
2012-03-12 16:56:57 +01:00
parent c1699b6b82
commit a4501fc442

View File

@@ -1391,7 +1391,7 @@ class unicode
return $no_diacritics; return $no_diacritics;
} }
public function remove_nonazAZ09($string, $keep_underscores = true, $keep_minus = true) public function remove_nonazAZ09($string, $keep_underscores = true, $keep_minus = true, $keep_dot = false)
{ {
$regexp = '/[a-zA-Z0-9'; $regexp = '/[a-zA-Z0-9';
if ($keep_minus === true) if ($keep_minus === true)
@@ -1402,6 +1402,11 @@ class unicode
{ {
$regexp .= '_'; $regexp .= '_';
} }
if ($keep_dot === true)
{
$regexp .= '\.';
}
$regexp .= ']{1}/'; $regexp .= ']{1}/';
$string = $this->remove_diacritics($string); $string = $this->remove_diacritics($string);