vendredi 30 juin 2017

How to check mimeType against a specific set of mimeTypes?

Original code:

if($mimeType == 'image/jpeg' or $mimeType == 'image/png' or $mimeType == 'image/gif' && filename)

I tried this, but it will include unwanted *.pdf

if ($mimeType == ('image/jpeg' ||'image/png' ||'image/gif') && filename)

How do I make the code shorter?

And why the inner parentheses are not working?

Aucun commentaire:

Enregistrer un commentaire