PHP 8.6.0 Beta 1 is available for testing

Voting

: eight minus six?
(Example: nine)

The Note You're Voting On

katzlbtjunk at hotmail dot com
18 years ago
Clean a string for use as filename by simply replacing all unwanted characters with underscore (ASCII converts to 7bit). It removes slightly more chars than necessary. Hope its useful. 

$fileName = 'Test:!"$%&/()=ÖÄÜöäü<<';
echo strtr(mb_convert_encoding($fileName,'ASCII'), 
    ' ,;:?*#!§$%&/(){}<>=`´|\\\'"', 
    '____________________________');

<< Back to user notes page

To Top