Файл: vsime.com/system/functions/file_name_html.php
Строк: 18
<? function file_name_html ($str)
{
$array_symbols_one = array("!","@","#","$","%","^","*","+","=","{","}",":",";","'",",","?","/","|","\","~","`");
$str = str_replace($array_symbols_one, "", $str);
$array_symbols_two_to = array('"','&','<','>');
$array_symbols_two_after = array("quot","amp","lt","gt");
$str = str_replace($array_symbols_two_to, $array_symbols_two_after, $str);
$str = str_replace(' ', '_', $str);
/*$str = str_no_repeat($str, "quot");
$str = str_no_repeat($str, "amp");
$str = str_no_repeat($str, "lt");
$str = str_no_repeat($str, "gt");*/
return $str;
}
function str_no_repeat ($str, $word)
{
$array_str_explode = explode($word, $str);
$num = 0;
$str = NULL;
foreach ($array_str_explode AS $key => $value)
{
$str = $str.$value.($num == 0?$word:NULL);
$num ++;
}
return $str;
}
?>