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) 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 Link to comment https://forums.phpfreaks.com/topic/85505-file-type/#findComment-436349 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.