0

My variable $FileExtension gives me the extension of a file. Now i want to check for some image extensions.

I tried this:

if($FileExtension == array('jpg', 'png', 'gif)) {
// do something
} 

what is the correct way?

Jack Maessen
  • 1,780
  • 4
  • 19
  • 51

1 Answers1

1
if(in_array($FileExtension,array('jpg', 'png', 'gif'))) {
// do something
}