alguém me sabe dizer o que faz esta parte de código php?
function normalize($string) {
global $db;
$ext = array(192, 193, 194, 195, 196, 197, 224, 225, 226, 227, 228, 229, 199, 231, 200, 201, 202, 203, 232,
233, 234, 235, 204, 205, 206, 207, 236, 237, 238, 239, 210, 211, 212, 213, 214, 216, 242, 243, 244, 245,
246, 248, 209, 241, 217, 218, 219, 220, 249, 250, 251, 252, 221, 255, 253);
$norm = array(65, 65, 65, 65, 65, 65, 97, 97, 97, 97, 97, 97, 67, 99, 69, 69, 69, 69, 101, 101, 101, 101, 73,
73, 73, 73, 105, 105, 105, 105, 79, 79, 79, 79, 79, 79, 111, 111, 111, 111, 111, 111, 78, 110, 85, 85,
85, 85, 117, 117, 117, 117, 89, 121, 121);
$string = $db->add_special_chars($string);
$string = utf8ToUnicode($string);
// Using array insersect is slower
if (is_array($string))
{
foreach ($ext as $k => $e) {
if ($pos = array_search($e, $string)) {
$string[$pos] = $norm[$k];
}
}
$string = unicodeToUtf8($string);
}
return $string;
}
function post_slug($str)
{
return strtolower(preg_replace(array('/[^a-zA-Z0-9_ -]/', '/[ -]+/', '/^-|-$/'),
array('', '-', ''), $str));
}
function sanitize_var($value)
{
if (!is_numeric($value))
{
$value = post_slug($value);
$value = str_replace('amp','and',$value);
$value = str_replace('quot','',$value);
$value = str_replace('039','',$value);
$value = str_replace(' ','-',$value);
}
return $value;
}