function uc_csv_clean_filename in Ubercart CSV 6.2
Same name and namespace in other branches
- 7.2 uc_csv.module \uc_csv_clean_filename()
1 call to uc_csv_clean_filename()
File
- ./
uc_csv.module, line 575
Code
function uc_csv_clean_filename($str, $replace = array(), $delimiter = '-') {
setlocale(LC_ALL, 'en_US.UTF8');
if (!empty($replace)) {
$str = str_replace((array) $replace, ' ', $str);
}
$clean = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
$clean = preg_replace("/[^a-zA-Z0-9\\/_|+ -]/", '', $clean);
$clean = strtolower(trim($clean, '-'));
$clean = preg_replace("/[\\/_|+ -]+/", $delimiter, $clean);
return $clean;
}