Move function & fix string

This commit is contained in:
danpros 2024-02-27 10:56:38 +07:00
commit 18a6bc5cde
2 changed files with 19 additions and 19 deletions

View file

@ -1269,6 +1269,22 @@ function get_feed($feed_url, $credit)
}
}
// return tag safe string
function safe_tag($string)
{
$tags = array();
$string = preg_replace('/[\s-]+/', ' ', $string);
$string = explode(',', $string);
$string = array_map('trim', $string);
foreach ($string as $str) {
$tags[] = $str;
}
$string = implode(',', $tags);
$string = preg_replace('/[\s_]/', '-', $string);
return $string;
}
// Create Zip files
function Zip($source, $destination, $include_dir = false)
{