etsted Posted April 27, 2014 Share Posted April 27, 2014 $haystack = array("gif");$fileParts = array("extension" =>"GIF", nr2 => "JPG");$fileParts = $fileParts['extension'];$fileParts = strtolower($fileParts[0]);if(in_array($fileParts, $haystack)){ echo "right";} else { echo "false";} this returns false, how can i make it return true? in real life, the $fileParts array is acctaully $_FILES['fileName']['name'], where i try to make the extension into lower case before the array check Link to comment Share on other sites More sharing options...
Ingolme Posted April 27, 2014 Share Posted April 27, 2014 $fileParts is a string, so if you put [0] on it you'll only get the first letter of the string when passing it to strtolower() Link to comment Share on other sites More sharing options...
etsted Posted April 27, 2014 Author Share Posted April 27, 2014 even professionals like me can make mistakes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now