/**
* \brief Copy of $s without "accents".
*
* Returns a copy of which $s "accented" characters were converted by removing their "accent"
* (the converted characters are those of the associative table $ACCENTALPHA_TO_ALPHA from accentalpha_to_alpha.inc file).
*
* For example: <code>'Élément'</code> => <code>'Element'</code>.
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param null|string $encoding
*
* @return string
*/ function mb_str_accentalpha_to_alpha($s, $encoding=null) {
/**
* \brief
* Copy of $s without "accents"
* with the characters of the Greek alphabet were replaced
* and all non-alphanumeric characters are replaced by $replacement.
*
* Returns a copy of $s:
* - each "accented" characters is converted by removing its "accent"
* (the converted characters are those of the associative table $ACCENTALPHA_TO_ALPHA from accentalpha_to_alpha.inc file) ;
* - each characters of the Greek alphabet is converted to alphabetic characters
* (the converted characters are those of the associative table $GREEK_TO_ALPHA from greek_to_alpha.inc file) ;
* - each group of other characters is replaced by $replacement.
*
* For example: <code>'Élément ; α and ω.'</code> => <code>'Element_a_and_o_'</code>.
*
* Adopts the standard ONU/ELOT: see http://www.opimedia.be/DS/mementos/grecs.htm .
*
* If $strip
* then begins delete HTML tags.
*
* If $entity_decode
* then begins convert HTML entities to normal characters.
* (Previous PHP 5.4, all HTML entities are not supported!)
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param bool $strip
* @param bool $entity_decode
* @param string $replacement
* @param null|string $encoding
*
* @return string
*/ function mb_str_alphanormalize($s, $strip=false, $entity_decode=false, $replacement='_', $encoding=null) {
if ((('0' <= $c) && ($c <= '9'))
|| (('A' <= $c) && ($c <= 'Z'))
|| (('a' <= $c) && ($c <= 'z'))) { // alphanumeric character array_push($a, $c); $not_consecutive = true;
}
elseif (array_key_exists($c, $ACCENTALPHA_TO_ALPHA)) { // "accented" character -> 1 or 2 alphabetic characters array_push($a, $ACCENTALPHA_TO_ALPHA[$c]); $not_consecutive = true;
}
elseif (array_key_exists($c, $GREEK_TO_ALPHA)) { // Greek letter -> 1 or 2 alphabetic characters array_push($a, $GREEK_TO_ALPHA[$c]); $not_consecutive = true;
}
elseif ($not_consecutive) { // other characters -> $replacement, if not already preceded by a $replacement $not_consecutive = false; array_push($a, $replacement);
}
}
}
return implode($a);
}
/**
* \brief Copy of $s with the characters of the Greek alphabet were replaced.
*
* Returns a copy of $s with the characters of the Greek alphabet were converted to alphabetic characters
* (the converted characters are those of the associative table $GREEK_TO_ALPHA from greek_to_alpha.inc file).
*
* Adopts the standard ONU/ELOT: see http://www.opimedia.be/DS/mementos/grecs.htm .
*
* For example: <code>'α and ω'</code> => <code>'a and o'</code>.
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param null|string $encoding
*
* @return string
*/ function mb_str_greek_to_alpha($s, $encoding=null) {
/**
* \brief Copy of $s without "accents".
*
* Returns a copy of which $s "accented" characters were converted by removing their "accent"
* (the converted characters are those of the associative table $ACCENTALPHA_TO_ALPHA from accentalpha_to_alpha.inc file).
*
* For example: <code>'Élément'</code> => <code>'Element'</code>.
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param null|string $encoding
*
* @return string
*/
function mb_str_accentalpha_to_alpha($s, $encoding=null) {
#DEBUG
assert('is_string($s)');
#DEBUG_END
/**
* \brief
* Copy of $s without "accents"
* with the characters of the Greek alphabet were replaced
* and all non-alphanumeric characters are replaced by $replacement.
*
* Returns a copy of $s:
* - each "accented" characters is converted by removing its "accent"
* (the converted characters are those of the associative table $ACCENTALPHA_TO_ALPHA from accentalpha_to_alpha.inc file) ;
* - each characters of the Greek alphabet is converted to alphabetic characters
* (the converted characters are those of the associative table $GREEK_TO_ALPHA from greek_to_alpha.inc file) ;
* - each group of other characters is replaced by $replacement.
*
* For example: <code>'Élément ; α and ω.'</code> => <code>'Element_a_and_o_'</code>.
*
* Adopts the standard ONU/ELOT: see http://www.opimedia.be/DS/mementos/grecs.htm .
*
* If $strip
* then begins delete HTML tags.
*
* If $entity_decode
* then begins convert HTML entities to normal characters.
* (Previous PHP 5.4, all HTML entities are not supported!)
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param bool $strip
* @param bool $entity_decode
* @param string $replacement
* @param null|string $encoding
*
* @return string
*/
function mb_str_alphanormalize($s, $strip=false, $entity_decode=false, $replacement='_', $encoding=null) {
#DEBUG
assert('is_string($s)');
assert('is_bool($strip)');
assert('is_bool($entity_decode)');
assert('is_string($replacement)');
#DEBUG_END
if ((('0' <= $c) && ($c <= '9'))
|| (('A' <= $c) && ($c <= 'Z'))
|| (('a' <= $c) && ($c <= 'z'))) { // alphanumeric character
array_push($a, $c);
$not_consecutive = true;
}
elseif (array_key_exists($c, $ACCENTALPHA_TO_ALPHA)) { // "accented" character -> 1 or 2 alphabetic characters
array_push($a, $ACCENTALPHA_TO_ALPHA[$c]);
$not_consecutive = true;
}
elseif (array_key_exists($c, $GREEK_TO_ALPHA)) { // Greek letter -> 1 or 2 alphabetic characters
array_push($a, $GREEK_TO_ALPHA[$c]);
$not_consecutive = true;
}
elseif ($not_consecutive) { // other characters -> $replacement, if not already preceded by a $replacement
$not_consecutive = false;
array_push($a, $replacement);
}
}
}
return implode($a);
}
/**
* \brief Copy of $s with the characters of the Greek alphabet were replaced.
*
* Returns a copy of $s with the characters of the Greek alphabet were converted to alphabetic characters
* (the converted characters are those of the associative table $GREEK_TO_ALPHA from greek_to_alpha.inc file).
*
* Adopts the standard ONU/ELOT: see http://www.opimedia.be/DS/mementos/grecs.htm .
*
* For example: <code>'α and ω'</code> => <code>'a and o'</code>.
*
* If $encoding === null
* then use the internal character encoding.
*
* @param string $s
* @param null|string $encoding
*
* @return string
*/
function mb_str_greek_to_alpha($s, $encoding=null) {
#DEBUG
assert('is_string($s)');
#DEBUG_END