Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.

stripfilename

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.

stripfilename

Quote

stripfilename( string $filename )


Parameters
filename

Filename you want to strip. Remember to remove the file extension before parsing it through this function.

Return Values
Returns the filename stripped and ready for use.

Example
Code
<?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);
?>


Changelog
7.01.00 - Function added to PHPFusion