in reply to Checking File Types

or making use of a regex like
# note not sure where the file extension is within param, # I am assuming at end of string, anchoring the regex # to the end will speed it up slightly $regex = '\.(gif|jpg|jpe[g]?|jfif)(\s+|)$'; if ($filename !~ /$regex/o) { error("Your image needs to be in GIF or JPEG format."); }

/*
* And the Creator, against his better judgement, wrote man.c
*/