Using the PHP manual I've written a simple uploads script, however I need to limit it to certain types of files. At the moment I am thinking gifs, jpegs and swf files. I know that the mime type can be found using $FILES['userfile']['type'] and therefore I can write
if ($_FILES['userfile']['type'] != image/pjpeg) { echo "error"; exit(); }
However when it comes to allowing multiple file types I come unstuck. What should the code be to also allow image/jpeg and image/gif ?