Hey there,
I'm trying to write a script for uploading images but only with certain file extensions. Currently I have it working by:
[PHP]if (($FileExt = "jpg") || ($FileExt = "gif"))[/PHP]
ect, but is there a way i can do:
[PHP]$allowed = array("jpg", "gif");
if $allowed[/PHP]
I tried that but the if always turned out false.
What would be the correct way of doing this?
Thanks for your time.
I'm trying to write a script for uploading images but only with certain file extensions. Currently I have it working by:
[PHP]if (($FileExt = "jpg") || ($FileExt = "gif"))[/PHP]
ect, but is there a way i can do:
[PHP]$allowed = array("jpg", "gif");
if $allowed[/PHP]
I tried that but the if always turned out false.
What would be the correct way of doing this?
Thanks for your time.
Comment