Jamesking56 Posted August 30, 2008 Share Posted August 30, 2008 I am using Glob to get all Files & Folders, then I am checking whether they are Files or Folders and Echoing them out separatly...But, I want to now get the Filetype of the Files.How do I do that?? Link to comment Share on other sites More sharing options...
jlhaslip Posted August 30, 2008 Share Posted August 30, 2008 check the file extension by breaking down the filename using the period (dot) as a seperator Link to comment Share on other sites More sharing options...
Synook Posted August 31, 2008 Share Posted August 31, 2008 Or use the PECL FileInfo extension's finfo_file() or its deprecated native equivalent mime_content_type(). Link to comment Share on other sites More sharing options...
Jamesking56 Posted August 31, 2008 Author Share Posted August 31, 2008 Nevermind, I found a better way:$extension = pathinfo($file, PATHINFO_EXTENSION);using pathinfo(); with only PATHINFO_EXTENSION Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.