Strips a given filename from any unwanted characters and symbols so you can safely store the file on the server and the name in the database without any problems or security concerns.
Quote
stripfilename( string $filename )
<?php
require_once INCLUDES."infusions_include.php";
// Name of our test file
$file = "I am-Ã… test file!!!??.jpg";
// File name without file extension
$file_name = substr($file, 0, strrpos($file, "."));
// Stripped and safe file name
echo stripfilename($file_name);
?>