asmith Posted January 11, 2008 Share Posted January 11, 2008 is that posible i know a file name but not its type and get its type ? for example if have a file1.abc , i know the name file1 . can i get its type ? (abc) Quote Link to comment https://forums.phpfreaks.com/topic/85505-file-type/ Share on other sites More sharing options...
adam291086 Posted January 11, 2008 Share Posted January 11, 2008 you can use the explode function to split the filename from the ext. $extention = strtolower(end(explode('.', $file_type))); if ($extention != 'csv') { unlink($destination .$file_type); echo "invalid file"; } This is how i did it Quote Link to comment https://forums.phpfreaks.com/topic/85505-file-type/#findComment-436349 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.