Tuesday, January 24, 2006

PHP clean filename

Clean a string for filename


`echo "$clean" | tr A-Z a-z | tr "[]()&~@#$%^&*()_+=;:,.!' " "-" `;


This programming one liner allows you to clean the unwanted characters in a string. The list of characters is specified as the first parameter to the tr command.


Programming "One Liner" lookup terms:
str_replace tr

USE THIS PROGRAMMING ONE LINER AT OWN RISK AS AUTHOR CLAIMS NO RESPONSIBILITY.
If you would like more information on any of the commands, please feel free to contact me with your . You can also read other posts on programming code, lookup the programming terms displayed above or visit my network security blog. Other external programming blogs on Technorati and programming blogs on Google.