Anyone know of a function that checks if a filename is valid or not?
I couldnt find anything on Google.
I cant think of how to write one either, ereg is hard to use and I can never get it to work right. 🙁
by what criteria are you using to judge a valid/invalid filename? this will vary with different OS's and different filesystems.
anything with A-Z 0-9 a-z
and can include a dash or underscore, along with 1 period and an extension of no more than 4characters