Static Public Member Functions |
static | cleanString ($string, $separator= '-', $cleanPunctuation=TRUE, $cleanSlash=TRUE) |
static | cleanSeparators ($string, $separator=NULL, $toLowCase=TRUE) |
static | punctuationChars () |
static | i18nToAscII () |
Detailed Description
Definition at line 2 of file UrlTransliterate.php.
Member Function Documentation
static UrlTransliterate::cleanSeparators |
( |
|
$string, |
|
|
|
$separator = NULL , |
|
|
|
$toLowCase = TRUE |
|
) |
| |
|
static |
Clean path separators from a given string.
Trims duplicates and strips leading and trailing separators.
- Parameters
-
$string | The string to clean path separators from. |
$separator | The path separator to use when cleaning. |
- Returns
- The cleaned version of the string.
- See Also
- pathauto_cleanstring()
-
pathauto_clean_alias()
Definition at line 79 of file UrlTransliterate.php.
{
$output = $string;
if (isset($separator) && strlen($separator))
{
$seppattern = preg_quote($separator, '/');
$output = preg_replace("/^$seppattern+|$seppattern+$/", '', $output);
$output = preg_replace("/$seppattern+\/|\/$seppattern+/", "/", $output);
$output = preg_replace("/$seppattern+/", $separator, $output);
}
if ($toLowCase)
{
$output = strtolower($output);
}
return $output;
}
static UrlTransliterate::punctuationChars |
( |
| ) |
|
|
static |
Return an array of arrays for punctuation values.
Returns an array of arrays for punctuation values keyed by a name, including the value and a textual description. Can and should be expanded to include "all" non text punctuation values.
- Returns
- An array of arrays for punctuation values keyed by a name, including the value and a textual description.
Definition at line 119 of file UrlTransliterate.php.
{
"double_quotes"=>'"',
"quotes"=>"'",
"backtick"=>"`",
"comma"=>",",
"period"=>".",
"hyphen"=>"-",
"underscore"=>"_",
"colon"=>":",
"semicolon"=>";",
"pipe"=>"|",
"left_curly"=>"{",
"left_square"=>"[",
"right_curly"=>"}",
"right_square"=>"]",
"plus"=>"+",
"equal"=>"=",
"asterisk"=>"*",
"ampersand"=>"&",
"percent"=>"%",
"caret"=>"^",
"dollar"=>"$",
"hash"=>"#",
"at"=>"@",
"exclamation"=>"!",
"tilde"=>"~",
"left_parenthesis"=>"(",
"right_parenthesis"=>")",
"question_mark"=>"?",
"less_than"=>"<",
"greater_than"=>">",
"back_slash"=>'\\',
);
}
The documentation for this class was generated from the following file: